The most elementary elements from “set theory” and logic are a good starting point for our review. The quotes are necessary since the term set theory as it is understood today applies to the axiomatic version, which is a vast field of knowledge, methods, tools and research [cf. Shoenfield (1967); Tourlakis (2003b)]—and this is not what we outline here. Rather, we present the standard notation and the elementary operations on sets, on one hand, and take a brief look at infinity and the diagonal method of Cantor’s, on the other. Diagonalization is a tool of significant importance in computability. The tiny fragment of concepts from set theory that you will find in this section (and then see them applied throughout this volume) are framed within Cantor’s original “naïve set theory”, good expositions of which (but far exceeding our needs) can be found in Halmos (1960) and Kamke (1950).

We will be forced to interweave our exposition of concepts from set theory with concepts—and notation—from elementary logic, since all mathematics is based on logical deductions, and the vast majority of the literature, from the most elementary to the most advanced, employs logical notation; e.g., symbols such as “∀” and “∃”.

The term “set” is not defined , 11 in either the modern or in the naïve Cantorian version of the theory. Expositions of the latter, however, often ask the reader to think of a set as just a synonym for the words “class”, 12 “collection”, or “aggregate”. Intuitively, a set is a “container” along with its contents—its elements or members . Taken together, contents and container, are viewed as a single mathematical object . In mathematics one deals only with sets that contain mathematical objects (so we are not interested in sets of mice or fish).

Images   Since a set is itself an object , a set may contain sets as elements.   Images

All the reasoning that one does in order to develop set theory—even that of the naïve variety—or any part of mathematics, including all our reasoning in this book, utilizes mathematical logic. Logic is the mathematics of reasoning and its “objects” of study are predominantly mathematical “statements” or “assertions”—technically known as formulae 13 —and mathematical proofs. Logic can be applied to mathematics either experientially and informally—learned via practice as it were—or formally. The predominance of mathematical writings apply logic informally as a vehicle toward reaching their objectives. 14 Examples of writings where logic is formally applied to mathematics are the volumes that Bourbaki wrote, starting here [Bourbaki (1966)]. More recent examples at the undergraduate and graduate levels are Gries and Schneider (1994) and Tourlakis (2003b) respectively.

In this volume we apply logic informally. An overview is provided in the next subsection.

1.1.1   A Detour via Logic

As is customary in mathematics, we utilize letters , upper or lower case, usually from near the end of the alphabet ( u , v , y , x , z , S , T , V ) to denote, that is, to name mathematical objects—in particular, sets .

Images   By abuse of language we say that u , v , y , x , z , S , T , V are (rather than denote or name ) objects. These letters function just like the variables in algebra do; they are object-variables .   Images

As is the case in algebra, the variables x , y , z are not the only objects set theory studies. It also studies numbers such as 0, 1, −7 and π, matrices such as ( Images ) and objects that are the results of function applications such as 7 23000 , x y z and 2 x .

Unlike axiomatic set theory, which introduces its objects via formal constructions, naïve set theory allows us to use, “off the shelf”, all the mathematical objects such as the above, as well as, of course, objects that are sets such as {2, 3, {1}} and A ∪ B . 15

Images   Logicians like to call mathematical objects terms . We utilize in this book the generic names t and s (with primes or subscripts, whenever we need more than two such names) to refer to arbitrary terms that we do not want to be specific about.   Images

1.1.1.1 Definition. The simplest possible relations of set theory are of just two forms : t Images s —read “ t is a member of s ” or “ t belongs to s ”—and t = s , read “ t is equal to s ”, where, as we indicated above, t and s are any terms whatsoever.

These relations are the atomic formulae (of set theory). The qualifier “atomic” refers to two facts:

  • These two types cannot be expressed (simulated) in terms of simpler relations by using the notation and tools of logic.
  • Using these two relations as building blocks we can construct every possible formula of set theory as we will explain shortly. Images

1.1.1.2 Example. x Images y , u = v , z Images S and 3 Images z and 2 z = y 3 are atomic formulae.

Images , the set of all natural numbers (i.e., all the numbers that we obtain by starting at 0 and repeatedly adding 1: 0, 1, 2, 3, 4, ...), is an important constant in naïve set theory.

Images   By “ Images ... is an important constant” we mean, of course, via the habitual abuse of language exercised by mathematicians, the accurate “ Images ... denotes (or names ) an important constant”.   Images

Here is an example that uses Images in an atomic formula: −7 Images Images . Incidentally, this formula makes (i.e., encodes) a false statement; we say the formula is false .

One may form this basic formula as well, Images , where the meaning of the symbols “{...}” and “ Images ” will be introduced later in this section.

Yet another example is {1} Images {2, 1}—a false statement (formula) as we will be able to determine soon. Images

Logic (and mathematics) contain much more complex formulae than those of the atomic variety. The added complexity is achieved by repeatedly “gluing” atomic formulae together employing as glue the logical, or Boolean, connectives

¬, ∧, ∨, →, ≡

and the quantifiers

∀, ∃

Images   As we have noted already, unlike the case of naïve set theory—where we take for granted the a priori presence of all objects of mathematics, such as 3, –7, Images and x y z u — axiomatic set theory needs no a priori existence of any objects. Starting just with the relations x Images y and x = y it uses powerful rules, which can be used to build not only all formulae of set theory, but also all the objects of mathematics that we are familiar with, such as the above-mentioned and many others. Images

What about arithmetic? The arithmetical objects of “pure” (Peano) arithmetic are the variables, constants, and outputs of functions applied on objects that we have already built. What are its formulae? If we are thinking of pure arithmetic, which is studied outside set theory, then we may choose as atomic formulae all those that can be built from the three start-up relations z = x + y , z = x × y and z = x y : new atomic formulae result by substituting arbitrary (arithmetical) objects for variables. Note that the equality relation is obtained from z = x + y by substituting 0 for y .

All formulae of arithmetic can be built, starting from the atomic ones, as explained in the general Definition 1.1.1.3 below. This assertion is revisited in Subsection 2.11.1 .

Gödel showed in Gödel (1931) that the atomic formula z = x y is, well, not atomic : It can be simulated (built) within pure arithmetic starting just with z = x + y and z = x × y .

Images   The “practicing mathematician” prefers to work within an “impure” arithmetic, where he has access to sets and their notations, operations, and properties. In particular, this impure arithmetic employs set variables and, more generally, set objects in addition to number variables and number objects.   Images

Throughout this volume a formula (whether specific to set theory or to any other area in mathematics, such as arithmetic—pure or impure) will be denoted by an upper case calligraphic letter, such as Images , Images , Images , Images .

We now indicate how formulae are put together using brackets, connectives, and quantifiers, employing atomic formulae as basic building blocks. The definition below is generic, thus unified: it applies to the structure of all formulae of mathematics. The choice of atomic formulae (which presupposes an a priori choice of mathematical symbols, such as 0, +, Images ) and of types of variables is what determines whether we build set theory formulae, pure or impure arithmetic formulae, or “other”.

1.1.1.3 Definition. A set theory formula is one of:

(1) An atomic formula ( 1.1.1.1 ).

(2) (¬ Images ), where Images is known to be 16 a formula.

(3) ( Images ∧ Images ), where Images and Images are known to be formulae.

(4) ( Images ∨ Images ), where Images and Images are known to be formulae.

(5) ( Images → Images ), where Images and Images are known to be formulae.

(6) ( Images ≡ Images ), where Images and Images are known to be formulae.

(7) ((∀ x ) Images ), where Images is known to be a formula and x is any variable.

(8) ((∃ x ) Images ), where Images is known to be a formula and x is any variable. We say in the last two cases that “ Images is the scope of Qx , where Q is ∀ or ∃”.

We call ∀ the universal and ∃ the existential quantifiers. We will extend the terminology “quantifier” to apply to the compound symbols (∀ x ) or (∃). Images

1.1.1.4 Definition. (Immediate Predecessors) Let Images be a formula. By 1.1.1.3 it has one of the forms (1)–(8). If it is of type (1), then it has no immediate predecessors —i.e., it was not built using connectives or quantifiers from simper formulae. If it has the forms (2)–(8), then in each case its immediate predecessors are the formulae Images and Images [the latter enters in cases (3)–(6)] that were used to build it. We use the acronym ip for immediate predecessors . Images

Images   The presence of brackets guarantees that the decomposition or deconstruction of a formula into its immediate predecessors is unique. This fact can be proved, but it is beyond our aims so we will not do so here [see Bourbaki (1966); Enderton (1972); Tourlakis (2008, 2003a)]. Logicians refer to it as the unique readability of a formula.   Images

1.1.1.5 Example. Here are some formulae:

x Images y , 3 = z , z = x w —by (1),

(¬ x = y )—by (1), followed by an application of (2); we usually write this more simply as “ x ≠ y ”,

( x Images y ∨ z = x w )—by (1), followed by an application of (4),

((∀ x ) z = x w )—by (1), followed by an application of (7),

( x = 0 → x = 0)—by (1), followed by an application of (5), and

( x = 0 → ((∀ x ) x = 0))—by (1), followed by an application of (7) to obtain ((∀ x ) x = 0), and then by an application of (5).

The reader should check that we inserted brackets precisely as prescribed by Definition 1.1.1.3 . Images

Images    1.1.1.6 Remark. (Building a formula) If Images is (stands for, that is) a formula we can deconstruct it according to Definition 1.1.1.3 using a natural process.

Initialize : Write down Images . Flag it pending .

Repeat this process until it cannot be carried further :

Images

Write down, above whatever you have written so far, the ip of all pending formulae (if they have ip); and remove the flag “pending” from the latter. Add the flag to the ones you have just written.

Images

The process is terminating since we write shorter and shorter formulae at every step ( and remove the flags); we cannot do this forever!

Clearly, if we now review from top to bottom the sequence that we wrote, we realize that it traces forward the process of constructing Images by repeated application of Definition 1.1.1.3 . This top-down view of our “deconstruction” is a formula-construction sequence for Images .

For example, applying the process to the last formula of the preceding example we get:

x = 0

x = 0

((∀ x ) x = 0)

( x = 0 → ((∀ x ) x = 0))

where one copy of x = 0 was contributed by the bottom formula and the other (at the top) by ((∀ x ) x = 0).

Going forward we can discard copies that we do not need. Thus a valid formula construction is also this one:

x = 0

((∀ x ) x = 0)

( x = 0 → ((∀ x ) x = 0))

Indeed, we validate the first formula in the sequence via (1) of 1.1.1.3 ; the second using the first and (7); and the last one using the first two and (5). Images

A term such as x 2 has x as its only input variable. An atomic formula such as z Images Images has z as its only input variable, while the (atomic) formula x + y = y w has x , y and w as input variables. Whenever we want to draw attention to the input variables—say, x , u , S and z —of a term t or a formula Images we will write t ( x , u , S , z ) or Images ( x , u , S , z ), respectively. This is entirely analogous to writing “ f ( x , z ) = x 2 + sin z ” in order to name the expression (term) x 2 + sin z as a function f ( x , z ) of the two listed variables.

1.1.1.7 Definition. (Input Variables—in Terms) All the variables that occur in a term—other than an x that occurs in a term of the form { x : ...} (which is a set object that will be introduced shortly)—are input variables. Images

1.1.1.8 Example. Thus, the term x has x as its only input variable; while the term 3 has no input variables. x 2 z y has x , z , y as its input variables. We will soon introduce terms (set objects) such as { x : x = 0}. This object, which the reader may recognize as a fancy way to simply write {0}, has no input variables. Images

1.1.1.9 Definition. (Input Variables—in Formulae) A variable occurrence 17 in an atomic formula t Images s or t = s is an input occurrence precisely if it is an input occurrence in one of the terms t and s . Thus, “0 Images { x : x = 0}” has no input variables while “ x = 0” has one.

Formation rules (2)–(6) in Definition 1.1.1.3 “ preserve ” the input occurrences of variables in the constituent formulae Images and Images that we join together using one of ¬, ∧, ∨, →, ≡ as glue. On the other hand, each quantifier (∀ z ) or (∃ z ) forces each occurrence of a variable as described below to become non-input:

  • The occurrence z in the quantifier
  • Any occurrence of z in the scope of said (∀ z ) or (∃ z )

Thus, if we start with Images ( x , y , z ), of inputs x , y , z , the new formula (( Qy ) Images ( x , y , z )), where Q stands here for one of ∀, ∃, has only x and z as input variables. Images

Images   We have carefully referred to occurrences , rather than variables , in the above definition. A variable can be both input and non-input. An occurrence cannot be both. For example, in ( x = 0 → (∀ x ) x = 0) the first x -occurrence is input; the last two are non-input. The variable x is both.

Thus “x is an input/non-input variable” (of a formula) means that there are occurrences of x that are input/non-input .

The standard name utilized in the literature for input variables is free variables . Non-input variable occurrences are technically called bound occurrences , but are also called apparent occurrences , since even though they are visible, they are not allowed—indeed it makes no sense—to receive arguments (input). This is analogous to the “Σ-notation” for sums: Images i means 1 + 2 + 3. While we can “see” the variable i , it is not really there! 18 It cannot accept inputs. For example, “ Images 2” is total nonsense.

The jargon input/non-input is deliberately chosen: We may substitute terms only in those variable occurrences that are free (input) .   Images

If Images is some formula and x , y , z , ... is the complete list of variables that occur in it, we can draw attention to this fact by writing Images ( x , y , z , ...). If x , y , z , ... is a list of variables such that some 19 among them occur in Images , then we indicate this by Images [ x , y , z , ...].

In the context of Images [ x , y , z , ...] [or Images ( x , y , z , ...)], Images [ t 1 , t 2 , t 3 , ...] [correspondingly Images ( t 1 , t 2 , t 3 , ...)] stands for the formula obtained from Images by replacing each original occurrence of x , y , z , ... in Images by the terms t 1 , t 2 , t 3 , ... respectively.

Some people call this operation simultaneous or parallel substitution. Thus, if Images [ x , y ] names “ x = y ”, whereas t 1 is y + 1, and t 2 is 5, then Images [ t 1 , t 2 ] is “ y + 1 = 5” and not “5 + 1 = 5”. The latter result would have been obtained if we first substituted t 1 in x to obtain y + 1 = y , and then substituted t 2 in y to obtain 5 + 1 = 5. If we are to do this “simultaneous substitution” right, then we must not substitute t 2 into the y to the left of “=”; this y is not “original”.

Images   Observe also that if x does not occur in Images [ x ], then Images [ t ] is just the original Images .   Images

Before we turn to the meaning (and naming) of the connectives and quantifiers, let us agree that we can get away with much fewer brackets than Definition 1.1.1.3 prescribes. The procedure to do so is to agree on connective and quantifier “priorities” so that we know, in the absence of brackets, which of the two connectives/quantifiers is supposed to “win” if they both compete to apply on the same part in a formula.

By analogy, a high school student learns the convention that “× has a higher priority than +”, thus 2 + 3 × 4 means 2 + (3 × 4)—that is, × rather than + claims the part “3”.

Images   Our convention is this: The connective ¬ as well as the quantifiers ∀ and ∃ have the highest priority, equal among the three. In order of decreasing priority, the remaining binary connectives 20 are listed as ∧, ∨, →, ≡. If two binary connectives compete to glue with a subformula, then the higher-priority one wins. For example, assuming that Images has already in place all the brackets that are prescribed by Definition 1.1.1.3 , then ... → Images ∨ Images means ... → Images Images ∨ Images , while ... ¬ Images ∧ Images means ... Images ¬ Images Images ∧ Images .

If two instances of the same binary connective compete to glue with a subformula, then the one to the right wins. For example, assuming that Images has all the brackets prescribed by Definition 1.1.1.3 in place, then ... → Images → Images means ... → Images Images → Images .

Similarly, if any of ¬, ∀, ∃ compete for a part of a formula, again the one to the right wins. E.g., ... ¬(∀ x )(∃ y ) Images Images means ... Images Images , where once again we assumed that Images has all the brackets prescribed by Definition 1.1.1.3 already in place.   Images

How do we “compute” the truth or falsehood of a formula? To begin with, to succeed in this we must realize that just as a function gives, in general, different outputs for different inputs, in the same way the “output” of a formula, its truth-value , can only be computed, in general, if we “freeze” the input variables. For each such frozen instance of the input side, we can compute the output side: true or false.

But where do the inputs come from? For areas of study like calculus or arithmetic the answers are easy: From the set of real numbers—denoted by Images —and the set of natural numbers respectively.

For set theory it sounds easy too: From the set of all sets!

If it were not for the unfortunate fact that “the set of all sets” does not exist, or, to put it differently, it is a non-set class due to its enormity, we could have left it at that. To avoid paradoxes such as “a set that is not a set”—cf. Section 1.3 on diagonalization for an insight into why some collections cannot be sets—we will want to take our inputs from a (comfortably large) set in any given set-theoretic discussion: the so-called reference set or domain .

Images    1.1.1.10 Remark. The mathematician’s intuitive understanding of the statement “ Images is true (resp. false )” is that “ Images is true (resp. false) for all the possible values of the free (input) variables of Images ”.

Thus, if we are working in arithmetic, “2 n + 1 is odd” means the same thing as “it is true that, for all n Images Images , 2 n + 1 is odd”. “2 n > n ” again omits an implied prefix “it is true that, for all n Images Images ”. An example of a false statement with input variables is “2 n is odd”. Images

1.1.1.11 Definition. An instance of a formula Images , in symbols Images ′, is a formula obtained from Images by replacing each of its variables by some value from the relevant reference set.

Clearly, Images ′ is variable-free—a so-called closed formula or sentence —and therefore it has a well-defined truth-value: exactly one of true or false .

Sometimes we use more explicit notation: An instance of Images ( x , y , z , ...) or of Images [ x , y , z , ...] is Images ( i , j , k , ...) or Images [ i , j , k , ...], respectively, where i , j , k , ... are objects (constants) from the reference set.

Images ′ and Images ′ are consistent or common instances of Images and Images if every free variable that appears in both of the latter receives the same value in both instances. Images

Images    1.1.1.12 Example. Let Images stand for “ x ( x + 1) is even”, Images stand for “2 x + 1 is even” and Images stand for “ x is even”, where x is a variable over Images . Then,

Images    is true,                            
Images    is false, and                    
Images     is neither true, nor false.  

The lesson from this is that if the truth-value of a formula depends on variables, then not true is not necessarily the same as false . Images

We will not be concerned with how the truth-value of atomic formulae is “computed”; one can think of them as entities analogous to “built-in functions” of computer programming: Somehow, the way to compute their true/false output is a matter that a hidden procedure (alternatively, our math knowledge and sophistication) can do for us.

Our purpose here rather is to describe how the connectives and quantifiers behave toward determining the truth-value of a complex formula.

In view of Remark 1.1.1.10 , the road toward the semantics of Images ∨ Images , ((∀ x ) Images ), etc., passes through the semantics of arbitrary instances of these; namely, we need to only define the meaning of Images ′ ∨ Images ′, ((∀ x ) Images )′, etc., respectively.

1.1.1.13 Definition. (Computing with Connectives and Quantifiers) Let Images and Images be any formulae, and Images ′ and Images ′ be arbitrary common instances ( 1.1.1.11 ).

(1) ¬ Images ′—pronounced “not Images ′”—is true iff 21 Images ′ is false.

(2) Images ′ ∨ Images ′—pronounced “ Images ′ or Images ′”—is true iff either Images ′ is true or Images ′ is true, or both (so-called inclusive or ).

(3) Images ′ ∧ Images ′—pronounced “ Images ′ and Images ′”—is true iff Images ′ is true and Images ′ is true.

(4) Images ′ → Images ′—pronounced “if Images ′, then Images ′”—is true iff either Images ′ is false or Images ′ is true, or both . 22

(5) Images ′ ≡ Images ′—pronounced “ Images ′ iff Images ′”—is true just in case 23 Images ′ and Images ′ are both true or both false.

(6) The instance (∀ x ) Images ( i 1 , ..., i m , x , j 1 , ..., j n )—which is pronounced “for all x , Images ( i 1 , ..., i m , x , j 1 , ..., j n ) (holds)” 24 — is true iff, for all possible values k of x from the domain, Images ( i 1 , ..., i m , k , j 1 , ..., j n ) is true.

(7) The instance (∃ x ) Images ( i 1 , ..., i m , x , j 1 , ..., j n ) —which is pronounced “for some x , Images ( i 1 , ..., i m , x , j 1 , ..., j n ) (holds)”—is true iff, for some value k of x from the domain, Images ( i 1 , ..., i m , k , j 1 , ..., j n ) is true. Images

Images    1.1.1.14 Remark. (Truth Tables) The content of the preceding definition—cases (1)–(5)—is normally captured more visually in table form (we have removed the primes for readability):

Images

We read the table as follows: First, the symbols t and f stand for the values “true” and “false” respectively. Second, the two columns to the left of the vertical line ║ give all possible pairs of values (outputs) of Images and Images . Third, below ¬ Images , Images ∨ Images , etc., we list the computed truth-values (of the formulae of the first row) that correspond to the assumed Images and Images values.

The odd alignment under ¬ Images is consistent with all the others: It emphasizes the placement of the “result” under the “operator”—here ¬—that causes it. Images

Images    1.1.1.15 Remark. According to Remark 1.1.1.10 ,

Images

means precisely this:

Images

By 6 of Definition 1.1.1.13 , (*) means

For every choice of the i l and j r from the reference set,

and

for all possible values k of x from the domain,

Images ( i 1 , ..., i m , k , j 1 , ..., j n ) is true

The above, and hence also (†), translate via Remark 1.1.1.10 as

Images

Iterating this observation yields that (‡) is an equivalent statement to the one we obtain by quantifying universally any—in particular, all —of the variables y 1 , ..., y m , x , z 1 , ..., z n of Images . That is,

Adding or removing a “(∀ x )” at the leftmost end of the formula makes no difference to the latter’s meaning.

Hm. This begs the question: Then what do we need the universal quantifier for? Images

1.1.1.16 Example. We note easily that, say, with Images (the reals) as our domain, x = 0 → x = 0 is true (cf. 4 in 1.1.1.13 ). However, x = 0 → (∀ x ) x = 0 is not, since its instance 0 = 0 → (∀ x ) x = 0 is false: to the left of → we have true, while to the right we have false.

Thus, adding or removing a “(∀ x )” to parts of a formula can make a difference in meaning! The universal quantifier is useful after all. Images

Images   Carrying around the predicate “is true” all the time is annoying. We will adopt immediately the mathematician’s jargon: Simply stating “ Images ( x , y , ...)” is synonymous to “ Images ( x , y , ...) is true” or “ Images ( x , y , ...) holds”.   Images

1.1.1.17 Example. Let Images be our domain. Then,

Images

is true. It says that “for every y , an x exists 25 such that y < x ”. According to 1.1.1.15 there is an implied (∀ y ) at the beginning of the formula.

Note that there is no single value of x that makes (1) true (because Images has no upper bound). For each value n of y , n + 1 is an appropriate value of x (so are n + 2, 2 n + 1, etc.)

How can we write down the (false) statement that one value of x works for all y ?

(∃ x ) (∀ y ) y < x

A final remark: How do we write that “there exists a unique x such that Images is true” (where Images is any formula)?

(∃ x ) Images Images [ x ] ∧ ¬(∃ z ) ( Images [ z ] ∧ x ≠ z ) Images

Fortunately, there is a short form for the above (∃! reads “for some unique”)

Images

1.1.1.18 Example. The reader probably already knows that there is redundancy in the chosen set of connectives, that is, some of them can be simulated by the others.

For example, it is immediate by comparing (4), (1), and (2) in 1.1.1.13 , that Images → Images is the same as (has the same meaning as) ¬ Images ∨ Images . Similarly, Images ≡ Images is the same as ( Images → Images ) ∧ ( Images → Images ).

Even Images ∧ Images can be expressed via ¬ and ∨ as ¬(¬ Images ∨ Images ). This is easiest to see, perhaps, via a truth-table:

Images

The numbers such as “(1) t ” in the first row indicate order of evaluation using the operator at the top of the column. Comparison of the column labeled (4) with the last column shows that each of Images ∧ Images and ¬(¬ Images ∨ Images ) yield the same output for any given value-pair of Images and Images . Thus we proved the equivalence of the Images ∧ Images and ¬(¬ Images ∨ Images ). This result is known as “de Morgan’s Law”. Images

1.1.1.19 Exercise. Prove that Images ∨ Images can be expressed as ¬(¬ Images ∧ Images ). This is the “other” (technically dual of) de Morgan’s Law. Images

1.1.1.20 Example. We know [(7) of Definition 1.1.1.13 ] that (∃ x ) Images ( z 1 , ..., z m , x , y 1 , ..., y n ) means

Images

Images

Images

Now, the negation of “there is a k such that Images ( i 1 , ..., i m , k , j 1 , ..., j n )” is

Images

that is,

Images

(2) says the same thing as

Images

(1.2) – (1.3) , (1), and (3) yield (via 1.1.1.13 )

(∃ x ) Images ( i 1 , ..., i m , k , j 1 , ..., j n ) ≡ ¬(∀ x )¬ Images ( i 1 , ..., i m , x , j 1 , ..., j n )

By (1.1) and 1.1.1.10 , we have

(∃ x ) Images ( z 1 , ..., z m , x , y 1 , ..., y n ) ≡ ¬(∀ x )¬ Images ( z 1 , ..., z m , x , y 1 , ..., y n )

for short

Images

1.1.1.21 Exercise. Prove that (∀ x ) Images ≡ ¬(∃ x )¬ Images . Images

Images    1.1.1.22 Remark. We note that Images → Images is true, in particular, when no instance of Images is true, i.e., when Images is false —in all its instances, that is. In this case the so-called classical or material implication holds “vacuously”, even if there is no connection between Images and Images at all and even if Images is not true! For example, if Images is 0 ≠ 0 and Images is “in every Euclidean triangle the sum of the angles equals 9 π ”, then ( Images → Images ) is true. The same holds if Images stands for “ n is even”. The latter has both true and false instances over Images , but that is immaterial. In each chosen instance, Images ′ → Images ′ is true—that is ( 1.1.1.10 ), Images → Images is true.

Equally disturbing is the fact that while both sides of the arrow might be true, though totally unrelated, the implication will be true, as in Images → Images where Images is 0 = 0 and Images is “in every Euclidean triangle the sum of the angles equals 2 π ”.

The Intuitionists, a school of thought founded on the writings of Kronecker, Brouwer and Heyting, do not like this state of affairs. The intended meaning, or intended semantics, for their Images → Images , connects the hypothesis Images strongly to the conclusion Images . The meaning, informally speaking, is that, from a proof (intuitionistic proof, of course!) of Images , a proof for Images can be constructed .

We are not going to say what is an intuitionistic “proof”, as this is of no concern to us. As a matter of fact, “proof” (for classical logic) will be defined only later (see 1.1.1.34 ). At present, let the reader think of “proof” as a process used to establish that a formula holds. Nevertheless, the above stated intentions regarding (intuitionistic) proofs are a clear enough indication of how strongly Images and Images must be related before the Intuitionist will agree to write Images → Images .

In particular, in intuitionistic logic → and ∨ do not relate as in 1.1.1.18 above. In fact, in both logics Images → Images holds, however, in intuitionistic logic Images ∨ ¬ Images does not hold! Or as we say, the law of the excluded middle does not hold. Intuitively speaking, the reason behind this phenomenon is that the intuitionistic proofs are so structured that, to establish that a formula Images ∨ Images holds, in general you need to construct a proof of one of Images or Images .

For example, the following classical proof that there are irrational numbers 26 a , b such that a b is rational is unacceptable intuitionistically .

Take a = b = Images . If this works, done. If not, that means that Images is irrational .

Well, then take a = Images and b = Images . Now a b = Images = Images 2 = 2. A rational. End of proof.

Above, Images is “ Images is rational” and Images is “ Images is irrational”. We used the (classical) fact that Images ∨ Images is true, since one or the other of Images and Images is (classically) true. However, classically, we do not need to know which is which!

A thorough exposition of intuitionistic logic can be found in the advanced book of Schütte ([Schü]). Images

1.1.1.23 Example. Suppose that x does not occur free in Images [ x ].

Pause.   Ensure that this is consistent with the notation introduced in Definition 1.1.1.11 . Images

Then

Images

Indeed, let y , z , w , ... be the complete list of free variables of Images , where x is not one of them. To verify (1) we need to show that for any choice of values k , l , m , ... from the domain

Images

that is,

Images

We need to analyze (∀ x ) Images [ x , k , l , m , ...]. It says

“for all n in the domain, Images [ n , k , l , m , ...] is true”

But this is true exactly when Images ( k , l , m , ...) is, since n does not affect the output: the variable x is non-input in Images . Images

1.1.1.24 Exercise. Suppose we drop the condition “suppose that x does not occur free in Images [ x ]” above. Does (1) still hold? You must provide the “why”! Images

1.1.1.25 Exercise. In view of 1.1.1.15 , “ Images [ x ] is true” iff “(∀ x ) Images [ x ] is true”. So, is this observation not all that we need to assert (1)? See also the previous exercise. Images

Atomic formulae contain no Boolean connectives at all. On the other hand, formulae with a leading quantifier, ∀ or ∃, contain no explicit Boolean connectives: any Boolean connectives they may have are “hidden” in the quantifier’s scope. Thus, one may view these two categories of formulae as “ atomic, but from a Boolean point of view ”, meaning you cannot split them into simpler ones by simply removing a Boolean connective. For example, if you start with (∀ x )( x = 0 ∨ x = y ) and remove the ∨, you get the nonsensical (∀ x )( x = 0 x = y ). Logicians call these “Boolean atomic formulae” prime formulae but also Boolean variables .

1.1.1.26 Definition. (Prime Formulae; Tautologies) A prime formula or Boolean variable is either an atomic formula, or a formula with a leading quantifier.

If a formula Images —when viewed as a Boolean combination of prime formulae, that is, as a formula built from prime formulae using only the formation rules (2)–(6) of 1.1.1.3 —evaluates as t according to the truth table 1.1.1.14 , for all possible assumed truth-values of its Boolean variables, then we call it a tautology and write this concisely as ⊨ taut Images . Images

Images    1.1.1.27 Remark. Every formula is built by appropriately applying Boolean glue on a number of prime formulae: Indeed, in any formula built according to 1.1.1.3 we can identify all its maximal prime subformulae—that is prime subformulae not contained in larger prime subformulae.

For example, in (∀ x )( x = 0 → (∃ y ) x = y ) ∨ w = u ∧ u = 2 x we may indicate the prime subformulae by “boxing” them as below.

Images

Double-boundary boxes enclose maximal prime formulae. The Boolean structure of (1) is

Images

Only maximal prime formulae contribute to the Boolean structure and express the original formula as a Boolean combination of prime formulae glued together by connectives. The non-maximal prime formulae are hidden inside maximal ones .

The italicized claim above follows directly from an adaptation of the “deconstruction” in 1.1.1.6 :

Just replace the step

Write down, above whatever you have written so far, the ip of all pending formulae (if they have ip); and remove the flag “pending” from the latter.

by

Write down, above whatever you have written so far, the ip of all non-prime pending formulae (if they have ip); and remove the flag “pending” from the latter.

Conversely, a Boolean combination of prime formulae is a formula in the sense of 1.1.1.3 : Indeed, a Boolean combination is an expression built by applying (2)–(6) in the context of a formula-construction (cf. 1.1.1.6 ) with starting points prime formulae, rather than atomic formulae. Since a prime formula is a formula, the process leads to a formula. See Exercise 1.8.1 for a rigorous proof (that you will supply, equipped with the induction tool). Images

Images   The quantifier “(for all possible) assumed ” in Definition 1.1.1.26 is significant. It means that we do not compute the actual (intrinsic) truth-values of the constituent Boolean variables (in the domain that we have in mind)— even if they do have such a value ; note that x = y does not.

Rather, we assume for each prime formula, all the — in principle — possible output values ; that is, both of t and f .

For example, for the determination of tautologyhood of a formula, where x = x enters as a Boolean variable, we assume two possible output values, t and f even though we know that its intrinsic value is t .

In particular, x = x is not a tautology.

Pause. Ensure that this last observation fits with 1.1.1.26 ! Images

We indicate this fact by writing Images taut x = x .

Assuming all possible truth-values of a prime formula (rather than attempting to compute “the” value) is tantamount to allowing the Boolean structure and Boolean structure alone—that is how the connectives have glued the formula together—to determine the truth-value via truth tables ( 1.1.1.14 ).   Images

1.1.1.28 Example. Some tautologies: x = 0 → x = 0, (∀ x ) Images ∨ ¬(∀ x ) Images , x = y → x = y ∨ z = 2 2 w .

Some non-tautologies: x = 0 → x = 5, (∀ x ) x = x ∨ (∀ y ) y = y , x = y → x = w ∨ z = 2 2 w . For example, looking at the value assumptions below—or value assignments , as is the accepted term,

x = y := t

x = w := f, and

z = 2 2 w := f,

we see that x = y → x = w ∨ z = 2 2 w evaluates as f, thus it is indeed not a tautology. Incidentally, I used “:=” to denote (truth) value assignment. Images

1.1.1.29 Definition. (Tautological Implication) We say that Images 1 , ..., Images n tautologically imply Images iff ⊨ taut Images 1 → Images 2 → ... → Images n → Images .

We write Images 1 , ..., Images n ⊨ taut Images in this case. Images , we say, is (the result of) a tautological implication from Images 1 , ..., Images n . Images

Images    1.1.1.30 Remark. We note that a tautological implication preserves truth, from left to right. See exercise below. Images

1.1.1.31 Exercise. Let p 1 , ..., p m be all the Boolean variables that appear in the formulae Images 1 , ..., Images n , Images .

Show that Images 1 , ..., Images n ⊨ taut Images iff every set of values assigned to the Boolean variables that makes all the Images i t , also makes Images t . Images

1.1.1.32 Example. All of the following are correct: x = 0 ⊨ taut x = 0, x < y , y < z ⊨ taut x < y ∧ y < z , x = y ⊨ taut Images ∨ ¬ Images (no matter what Images stands for). Images ⊨ taut Images → Images is also correct, since Images → Images → Images , that is, Images → ( Images → Images ) can be readily verified as a tautology using either 4 of 1.1.1.13 or the truth table ( 1.1.1.14 ). A shortcut is to just consider the two assumed values, t and f , for Images . The second makes the formula true outright, while the first makes the bracketed subformula t , hence the whole formula t .

This is incorrect: x < y , y < z ⊨ taut x < z since choosing

x < y := t

y < z := t , and

x < z := f

we see that x < y → y < z → x < z evaluates as f , so it is not a tautology. Images

Images    1.1.1.33 Remark. (Capture of a Free Variable) Let Images ( x ) stand for (∃ y ) y ≠ x — recall that y ≠ x is short for ¬ y = x . It states (i.e., codifies the statement) “for any value of x there is a value of y that is different”. Assuming that our domain is Images , this is clearly a true statement. So is Images ( Z ), obtained by substituting z for x , or, in programming jargon, “calling” Images ( x ) with argument z .

What about Images ( y )? This is (∃ y ) y ≠ y which is evidently false: “there is a value of y which is different from itself”!

This is unfortunate because, intuitively, what Images ( x ) says should have nothing to do with the name of the input variable!

What happened here is that when we substituted y for x , the free y was captured —i.e., became bound —by a lurking quantifier, (∃ y ): y got into the latter’s scope.

We should never allow such substitutions since, as this example shows, they may change the intended meaning of the resulting formula. In general, a substitution into Images [ x ] that results into Images [ t ] should not be allowed, if the term t contains a free variable y that will become bound (captured) after the substitution .

Is there a workaround? Yes!

Consider an instance (∃ x ) Images ( i 1 , ..., i m , x , j 1 , ..., j n ) of

Images

and a consistent instance (cf. 1.1.1.11 ) (∃ u ) Images ( i 1 , ..., i m , u , j 1 , ..., j n ) of

Images

where u is a new variable. The two instances are equivalent, since if x = k works for the first, then u = k works for the second, and vice versa. The instance being arbitrary, we get the equivalence of (1) and (2), that is

(∃ x ) Images ( z 1 , ..., z m , x , w 1 , ..., w n ) ≡ (∃ u ) Images ( z 1 , ..., z m , u , w 1 , ..., w n )

In view of 1.1.1.20 and 1.1.1.21 , or directly using a similar argument as above, one sees at once that changing the bound variable of a universal quantifier into a brand new variable does not change the meaning either.

This leads to the so-called “ variant theorem ” of logic, that

Changing a bound variable in a formula into a new (i.e., not already used in the formula) variable does not change the meaning: the original and the new formulae are equivalent .

But then, given Images [ x ], we can always effect Images [ t ] with impunity as long as we rename out of harm’s way, before the substitution takes place, all the original bound variables: 27 All we need to do in a successful renaming is to ensure that none of them is the same as a free variable of t . Strictly speaking, in Images [ t ] we do not have the original formula Images , but a variant of the original—since we have renamed the latter’s bound variables. Nevertheless since the old and the new are equivalent, we will use the same name for both, Images . Images

We now turn to what a mathematician or computer scientist does with logic: He writes proofs.

1.1.1.34 Definition. (Proofs) A proof is a construction process that builds a finite length sequence of true formulae, one at a time. We normally write this sequence vertically on the page, with explanatory annotation. Three simple rules regarding what formula we may write at each (construction-) step govern the process. We may write

(1) A formula that we know as, or accept as, true.

(2) A formula that is a tautological implication of formulae already written in the course of the proof.

(3) (∀ x ) Images (..., x , ...) provided Images (..., x , ...) has already been written in the course of the proof.

Any formula Images that appears in a proof we call a theorem. We say that the proof “established” or proved the theorem Images . Images

Images   A theorem follows from certain axioms Γ. Saying just “theorem” does not indicate this dependence, unless what is the relevant set of axioms is clearly understood from the context. If in doubt, or if we are discussing theorems of various theories simultaneously, then we must name the applicable axiom set in each case by saying “Γ-theorem” or “theorem from Γ”.

It is clear from what we have developed so far, that steps (2) and (3) preserve truth (cf. 1.1.1.15 ). An application of step (3) is called application of generalization, or rule Gen, as we will say.

What exactly is going on in step (1)? Well, we know that some formulae are true because we recognize them as such outright, without the help of any complicated process; they are “initial” truths—or initial theorems —such as x = x , which is true in all mathematics, or x + 1 ≠ 0, which is true in a specific theory : arithmetic of the natural numbers. These initial theorems, whether they are universal or theory-specific, are called axioms .   Images

1.1.1.35 Remark. All axioms are “atomic theorems”, that is, they are obtained by an application of (1)—they are not “results” of the application of (2) or (3) on previous theorems written in the course of a proof.

As indicated in the Images -passage above, we have two types of axioms.

(a) Those that are true because of the way the formulae that express them are put together, using connectives and quantifiers. These axioms are not specific to any branch of mathematics: They hold for all mathematics .

We call such axioms logical . 28

With some ingenuity, a very small set of formulae 29 can be chosen, among the universally or absolutely true formulae, to serve as logical axioms. Read on!

For example, x = x and (∀ x ) Images [ x ] → Images [ t ] are such universal truths, and we will adopt both as logical axioms.

(b) A formula Images is a nonlogical axiom in a mathematical theory provided it is taken as an important start-up truth of the theory —an “atomic theorem”— not because of its form, but rather because of what it says in connection with the various symbols that are peculiar to the theory.

For example, x + 1 ≠ 0 is an important start-up truth—a nonlogical axiom—of (Peano) arithmetic over Images . There is nothing to render it “universal”; in fact, it is not a true statement if our domain is either the reals, Images , or the integers, Images (all of positive, negative and zero). Another nonlogical axiom, for Euclidean geometry, is “Euclid’s 5th postulate”, which asserts that through a point outside a line we can draw precisely one parallel to said line. Again, the existence of so-called non-Euclidean geometries shows that this is not a universal truth.

When we use the term “theory Γ”, we mean somewhat ambiguously, but equivalently, either

  • Γ is the set all its theorems, that is, the set of all formulae that can be proved starting from the axioms of the theory repeatedly applying the proof-tools (1)–(3) above.

    Or

  • Γ is identified with the set of all the postulated nonlogical axioms. Clearly, if we have the nonlogical axioms, then using the logical axioms that are common to all theories, along with the proof-process (1)–(3) above, we may write down, in principle, 30 all the theorems of the theory.

We prefer the viewpoint of the second bullet, as it gives prominence to our start-up assumptions; the nonlogical axioms.

The terminology “ Images is true in the theory ” simply means that Images is a theorem of the theory. Its truth is relative to the truth of the nonlogical axioms ; it is not absolute or universal. For example, “the sum of the angles of any triangle equals 180°” is true in (is a theorem of) Euclidean geometry. It is not true in (is not a theorem of) either Riemann’s or Lobachevski’s geometries.

That Images is true in a theory Σ will be denoted symbolically as Σ ⊢ Images .

Note that the logical axioms are not mentioned at the left of “⊢”. Thus, if Σ is empty and we have proved Images only using logical axioms, then we will write ⊢ Images .

It is immediate from the foregoing that since a proof is not obliged, in an applications of step (1) ( 1.1.1.34 ), to use any nonlogical axiom, that every theory also contains among its theorems all the absolute truths Images for which ⊢ Images . 31

It is clear that ⊢ is transitive, that is, if we have Σ ⊢ Images i for i = 1, ..., n , and also A 1 , ..., A n ⊢ Images , then Σ ⊢ Images . Indeed, we can clearly concatenate the proofs of each A i —in any order—and then append the proof of Images at the very end. What we get is a proof of Images as required.

Since at each step of writing a proof we look back rather than forward [steps (2) and (3)], it is clear that chopping off the “tail” of a proof at any point leaves us with a proof. This observation entails that when we attempt to prove a formula from given axioms, we just stop as soon as we have written the formula down. Images

1.1.1.36 Exercise. Elaborate on the remark above regarding the transitivity of ⊢. Images

1.1.1.37 Exercise. In mathematical practice we are allowed to use in a proof any already proved theorems, in a step of type (1) of 1.1.1.34 . Carefully justify this practice in the context of Definition 1.1.1.34 . Images

Images   Since rules (2) and Gen on 1.1.1.34 preserve truth, and the logical axioms are universally true, then so is any Images for which we have ⊢ Images . Logicians call the content of this observation soundness .   Images

1.1.1.38 Definition. (Logical Axioms) The usually adopted logical axioms are (forall choices of formulae, variables and terms that appear in them):

(i) All tautologies

(ii) (∀ x ) Images [ x ] → Images [ t ] (see conclusion of 1.1.1.33 )

(iii) Images [ x ] → (∀ x ) Images [ x ], provided x is not free in Images [ x ]

(iv) (∀ x )( Images [ x ] → Images [ x ]) → (∀ x ) Images [ x ] → (∀ x ) Images [ x ]

(v) x = x

(vi) t = s → ( Images [ t ] ≡ Images [ s ]) (see conclusion of 1.1.1.33 ).           Images

Images That the above logical axioms are adequate to prove all universal truths using the proof mechanism of 1.1.1.34 is a result of Gödel’s [completeness theorem; Gödel (1930)]. Images

1.1.1.39 Remark. It is easy to verify that all the logical axioms are indeed universal truths. For group (i) and (v) this is trivial. The “truth” expressed (codified) in group (ii) is that “if Images [ x ] is true for all objects in its domain, then it must be true if we take x to be a specific object t ”. Note that even if t has input variables, then as they vary over the domain they generate objects from the domain. The generated objects are part of “ all objects in its domain ”.

The truth of all formulae in group (iii) follows from a trivial modification of the argument in 1.1.1.23 .

Group (vi) is Leibniz’s characterization of equality: It states that replacing “equals by equals” in an argument slot ( x of of Images [ x ] in our case) produces the same result.

Finally, let us look at group (iv). For simplicity we assume that x is the only variable, so we will show the truth of (∀ x )( Images ( x ) → Images ( x )) → (∀ x ) Images ( x ) → (∀ x ) Images ( x ) in its domain. First off, this means

Images

Since (1) is an implication, 1.1.1.14 indicates that the only real work for us is if (∀ x )( Images ( x ) → Images ( x )) evaluates as t . If this is so, this means

Images

We now try to prove that the right hand side of the leftmost → must evaluate as t . As it too is an implication, we will only consider the real work case where (∀ x ) Images ( x ) is true, that is

For every k in the domain, Images ( k ) is t                   (3)

and try to obtain that

Images

is true. Now, via 1.1.1.14 , (2) and (3) give “For every k in the domain, Images ( k ) is t ”, which establishes (4). Images

1.1.1.40 Example. Here are some proofs written in extreme pedantry. (I) Establish the (universal) truth of Images [ t ] → (∃ x ) Images [ x ]. The proof follows:

(1)   (∀ x )¬ Images [ x ] → ¬ Images [ t ]  〈 axiom (ii)〉

(2)    Images [ t ] → ¬(∀ x )¬ Images [ x ]  〈(1) and rule (2) of proof-writing; 1.1.1.34 〉

(3)    Images [ t ] → (∃ x ) Images [ x ]       〈(2) and rule (2) of 1.1.1.34 , using 1.1.1.20 〉

The comments in 〈…〉-brackets explain why we wrote the formula to their left. The numbering to the left allows easy reference to previous formulae. The last step is “replacing equivalents by equivalents” in a Boolean combination. The result stays the same since it is as if we “called” Images → Images with inputs, first ¬(∀ x )¬ Images [ x ] and then (∃ x ) Images [ x ]. But these inputs have the same (truth) value, so both calls will return the same answer. Since step (2) has written a truth (why?), so has step (2).

(II) Establish that t = t for any term t. The proof follows:

(1)   x = x                          〈axiom (v)〉
(2)  (∀ x ) x = x                  〈(1) + Gen〉
(3)  (∀ x ) x = x → t = t     〉axiom (ii)〉
(4)   t = t                           〈(2, 3) + tautological implication〉 Images

1.1.1.41 Remark . In the second proof above we used two important tools explicitly. We identify both here so they can be used “off the shelf” in diverse situations in the future.

The step from (2) to (4) via (3) generalizes to the rule “from (the truth of) (∀ x ) Images [ x ] follows (the truth of) Images [ t ]”. This rule is called specialization or Spec. It follows from an application of this tautological implication, Images known as modus ponens, for short MP. The reader can easily verify that indeed MP is a tautological implication, so it qualifies as a proof-step of type (2) ( 1.1.1.34 ). Images

1.1.1.42 Exercise. Give a proof that from the truth of Images [ x ] follows the truth of Images [ t ].           Images

1.1.1.43 Example. We verify that with an assumption (nonlogical!) of the form Images → Images we can prove Images → (∀ x ) Images , on the proviso that x is not free in Images . That is, we verify, under the stated condition, that Images → Images ⊢ Images → (∀ x ) Images .

(1)   Images → Images                                                 〈hyp〉
(2)  (∀ x )( Images → Images )                                      〈(1) + Gen〉
(3)  (∀ x )( Images → Images ) → (∀ x ) Images → (∀ x ) Images    〈axiom (iv)〉
(4)  (∀ x ) Images → (∀ x ) Images                                 〈(2, 3) + MP〉
(5)     Images → (∀ x ) Images                                       〈(*)〉

In step (1) we said “hyp”. The formula is a “hypothesis”—a starting point; not something that we claim as true; a nonlogical axiom. In step (5) I wrote (*) so that I can explain the reasons for the step outside the proof, since the explanation is long, namely: (5) follows from (4) by replacing “equivalents for equivalents”— see 1.1.1.23 and the similar situation in 1.1.1.40 .

1.1.1.44 Exercise. Prove that Images → Images ⊢ ¬ Images → ¬ Images . The two sides of ⊢ are called contrapositives of each other. Images

1.1.1.45 Exercise. Prove that Images → Images ⊢ (∃) Images → Images as long as x is not free in Images . Hint. Rely on 1.1.1.44 and use 1.1.1.43 . Images

1.1.1.46 Example. Let us establish the familiar commutativity property of equality as a result of the logical axioms [in particular, of (v) and (vi); cf. p. 21 ].

Let Images [ z ] stand for z = x. An instance of Leibniz’s axiom is x = y → ( Images [ x ] ≡ Images [ y ]) i.e.,

x = y →( x = x ≡ y = x )                                (1)

We can now embark on a proof:

( a )     x = y → ( x = x ≡ y = x )   〈logical axiom (1)〉

( b )     x = x → x = y → y = x    〈tautological implication of (a)〉

( c )     x = x                                〈logical axiom〉

( d )     x = y → y = x                  〈(b, c) + MP〉

Step (b) takes some doing, but is easy. Recall 1.1.1.29 and 1.1.1.31 . We need to argue that if line (a) is t , then this forces line (b)

x = x →( x = y → y = x )                (2)

to be t as well. By the way, the Boolean variables here are x = x , x = y and y = x .

Well, the real work toward seeing that (2) is t is when x = x and x = y are t. If so, the assumption that line (a) is true forces x = x ≡ y = x to be true (because the part to the left of → in said line is). Since x = x is assumed t , 32 then so must y = x, which establishes (2).

Since the above proof contains no nonlogical axioms, we may write ⊢ x = y → y = x .

The reader will note that this is not a tautology, since x = y and y = x are distinct Boolean variables.

1.1.1.47 Exercise. Armed with the commutativity of =, prove the transitivity of =. That is, establish the claim ⊢ x = y → y = z → x = z .           Images

1.1.1.48 Example. There are a couple of trivial, but often-used proof tools. They are expressed in the form Images , Images , …⊢ Images , that is, “if I know that Images , Images , …hold—either because they are assumptions (e.g., could be nonlogical axioms) or are already proved theorems—then I can prove that Images holds as well”.

(a) Proof by cases. Images → Images , Images → Images ⊢ Images ∨ Images → Images .
It states that to prove that Images follows from a disjunction, it suffices to prove separately that Images follows from each case— Images and Images —of the disjunction.

(b) Ping pong. Images → Images , Images → Images ⊢ Images ≡ Images . It states that to prove an equivalence, Images ≡ Images , it suffices to prove each direction — Images → Images and Images → Images —separately, since, from the two directions taken as hypotheses jointly, we can prove the equivalence.

Each of (a) and (b) admit immediate proofs: Once we have assumed the hypotheses on each side, a tautological implication yields the conclusion at once [cf. 1.1.1.34 , rule (2) applied]. Images

A major proof tool of the mathematician and computer scientist is the so-called deduction theorem. It is stated without proof here—for us it is its statement that matters.

Images See Tourlakis (2003a) or Tourlakis (2008) for a proof of the deduction theorem, but be warned that the two versions in these references are different, because the specific foundations of logic in these two are different! The difference lies in how generalization is applied, and that affects the statement, and proof, of the deduction theorem. The present volume uses the style of generalization as it is practiced in the first cited reference. Images

1.1.1.49 Theorem. (Deduction Theorem) If we can prove Images from assumptions Γ and Images then we can prove Images → Images from the assumptions Γ alone, on a condition. The condition is that during the proof of Images from hypotheses Γ and Images , step (3) of 1.1.1.34 was never applied with a variable that occurs free in Images .

In other words, the free variables of Images during said proof are “frozen”; they behave like constants .

We can say the above symbolically as “if Γ, Images ⊢ Images , then Γ ⊢ Images → Images , on a condition, etc.”

What is the deduction theorem good for? Well, for one thing, it tells us that instead of proving Images → Images it suffices to prove the less complex—since the glue → and the part Images are removed— Images . For another, we have the added bonus of “knowing more” before starting the proof. While toward proving Images → Images we “knew” Γ, toward proving Images we also know Images .

Is the restriction on Images too limiting? Not really. In practice, say, we want to prove that Γ ⊢ Images ( x , y )→ Images ( z , y , w ). We proceed as follows:

Fix all the variables of Images , here x and y , to some unspecified values. Remember not to use either x or y in a rule Gen during the proof !
Assume now Images ( x , y ). Proceed to prove Images ( z , y , w )—recall that y is a “constant".
By the deduction theorem, we have proved Images ( x , y ) → Images ( z , y , w ) from just Γ, because we never performed generalization with the frozen x and y .

In practice we apply less pedantry in the process:

(1) We only say, “let us fix the values all free variables x, y , … in Images ”.
We are, of course, obliged to remember that this also fixes these same variables in Images , and everywhere else, throughout the proof , Thus, we cannot universally quantify any of these variables during the proof, nor can we (a subsidiary operation this; cf. 1.1.1.42 ) substitute a term into such “frozen” variables.

(2) The task ends as soon as we prove Images .
We do not need to repeat this kind of justification every time: “By the deduction theorem, we have proved Images → Images from just Γ, etc.”

We will see this proof technique applied many times in this book, starting from the next subsection.

Images ∧¬ Images . From the truth tables we know that this evaluates as f regardless of whether Images itself evaluates a t or f. The reader can verify at once, that for any Images , Images ∧¬ Images ⊨ taut Images . Images

1.1.1.50 Theorem. (Proof by Contradiction) For any closed Images , we have Γ ⊢ Images iff   Γ, ¬ Images ⊢ Images ∧¬ Images , for some Images .

Proof. Indeed, for the if -part, let Γ, ¬ Images ⊢ Images ∧¬ Images . By the deduction theorem (applicable without hedging as Images is closed) we get

Γ ⊢ ¬ Images → Images ∧¬ Images                 (1)

It is straightforward to see that ¬ Images → Images ∧¬ Images ⊨ taut Images , hence by transitivity of ⊢, we get Γ ⊢ Images .

only if -part. Say, Γ ⊢ Images . Adding to the assumptions Γ we can still prove Images (see that you agree! 1.1.1.34 ). Thus

Γ, ¬ Images ⊢ Images                 (2)

But also (why?)

Γ, ¬ Images ⊢¬ Images                 (3)

The trivial Images ,¬ Images ⊨ taut Images ∧¬ Images along with (2) and (3) above, and transitivity of ⊢, yield Γ, ¬ Images ⊢ Images ∧ ¬ Images . Images

Images (closed Images ) we start by “Assume, by way of contradiction, ¬ Images ” and then proceed to indeed obtain one. Images

1.1.1.51 Definition. A mathematical theory, given by its set of nonlogical axioms, is consistent or free from contradiction, provided it is impossible to prove a contradiction from its axioms. Otherwise it is called inconsistent. Images

Thus we can rephrase 1.1.1.50 as Γ ⊢ Images iff (the theory with axioms) Γ, ¬ Images is inconsistent.

Images 1.1.1.52 Remark. (“Everyday” Proof Style) A few important remarks are in order to conclude our digression into logic.

(1) The proof of truth of a formula using first principles from 1.1.1.13 and working directly with a reference set is now for us a thing of the past. The last time we utilized the method was to establish that all the logical axioms were indeed universal truths ( 1.1.1.39 —see also 1.1.1.33 ). From then on we will ride on the shoulders of our logical axioms 1.1.1.38 , and whatever other assumptions we take as true from time to time, to prove all our theorems, essentially “syntactically”, that is, by writing proofs according to 1.1.1.34 .

(2) The practicing mathematician or computer scientist uses a simplified, often shorter, and rather conversational version of the proofs with annotation that we presented so far (for example, in 1.1.1.43 and 1.1.1.46 ). We should get used to this relaxed style. Here is an example. We will establish that

                              ⊢ (∀ x )( Images ∧ Images ) ≡ (∀ x ) Images ∧ (∀ x ) Images

Proof. We employ ping pong. (→) direction: Assume (∀ x )( Images ∧ Images ) with all its free variables frozen (we are going via the deduction theorem). Remove the quantifier (Spec) to obtain Images ∧ Images and apply two tautological implications to obtain Images and Images Apply Gen to each to get (∀ x ) Images and (∀ x ) Images . A tautological implication yields what we want.

For the (←) direction, assume (∀ x ) Images ∧ (∀ x ) Images , freezing all free variables of the formula. Two tautological implications yield (∀ x ) Images and (∀ x ) Images . Two applications of Spec, followed by tautological implication yield Images ∧ Images . Via Gen we get what we want.

(3) We finally establish that Images → Images ⊢ (∀ x ) Images → (∀ x ) Images . Indeed, the hypothesis yields (∀ x ) ( Images → Images ) by Gen. We are done via axiom (iv) ( 1.1.1.38 ) and modus ponens. Images

1.1.1.53 Exercise . Establish the fact Images ≡ Images ⊢ (∀ x ) Images ≡ (∀ x ) Images .
      Hint. Use 1.1.1.52 . Images

1.1.1.54 Exercise . Establish the fact Images ≡ Images ⊢ (∃ x ) Images ≡ (∃ x ) Images .
      Hint. Use 1.1.1.53 . Images

1.1.1.55 Exercise . Establish the fact ⊢ (∃ x )( Images ⋁ Images ) ≡ (∃ x ) Images ⋁ (∃ x ) Images .
      Hint. Use 1.1.1.52 . Images

1.1.2 Sets and their Operations

We now return to our brief study of sets. The naïve set theory of Cantor is not axiomatic. In our very brief and elementary review of it we will deviate only slightly and adopt precisely one axiom. First off, consider the formulae x Images A and x Images B. By 1.1.1.38 (vi), we obtain 34

A = B → ( x Images A ≡ x Images B )

and further, via 1.1.1.43 we get (since x , A , B are distinct variables)

Images

Suppose next that A and B stand for sets—no such restrictive assumption was made above . Then (1) says that if two sets are equal, then every member of one ( x ) is a member of the other, and vice versa; they have precisely the same elements. Is the converse 35 true?

That it is so is a fundamental property of sets; a nonlogical axiom. It is the so-called axiom of extensionality .

Images

Images Extensionality says that the extension—what sets contain— is what matters to determine their equality. In particular, “structure” does not matter. Nor does “intention”: e.g., whether we say outright, “collect 1 and 2 into a set”, or, in a roundabout way, “collect the roots of the equation x 2 – 3 x + 2 = 0 into a set” we get the same set.

Taking (1) and (Ext) together (ping pong) we have [cf. (b) in 1.1.1.48 ]:

Images

Since x Images 2 and x Images 3 are false, as 2 and 3 are numbers and thus contain no elements,

(∀ x )( x Images 2 ≡ x Images 3) → 2 = 3

is false, since to the left of → we have a true formula, while to the right a false one. Thus, the restriction on the type of A and B in ( Ext ) and (2) is essential. Of course, (1) is valid for any type of variables A , B , x . Images

Images 1.1.2.1 Example . Let us introduce the notation-by-listing of sets, {…}, where the “…” is in each case replaced by an explicit listing of all the set members. Here are two examples: {1, 2, 1, 2, 2} and {2, 1}. These two sets are equal by inspection, according to extensionality, for every element of one appears in the other, and vice versa. In particular, neither multiplicity, nor order of listing matter . Only the presence of an element matters, not where (in the listing), or how many times. So, we may write {1, 2, 1, 2, 2} = {2, 1} or indeed {2,1} = {1, 2,1, 2, 2}.

It should be clear that only the (intuitively) finite sets (a concept we will soon mathematically define) can be depicted by listing; and this only in principle, since we may not want to list a set of one trillion elements. By the way, writing Images = {0, 1, 2, ...} is not a by-listing depiction of Images , rather, it is a sloppy and abused notation (yet surprisingly common). The “…” indicates an unending, and understood from the context, process whereby the next element is generated by adding one to the previous. The notation taken out of context is nonsensical and gives no clue as to what “…” means. Images

The notation A ⊆ B , read “ A is a subset of B ”, or “ B is a superset of A”, means that every member of A is in B as well. So it is given by the mathematical definition below:

Images

Images A → x Images B ). But to so prove, it suffices to prove instead x Images A → x Images B , since an application of Gen to this formula produces the preceding one.

Perfect! One can then proceed as follows: “Fix x and assume x Images A ”. All that one needs to do next is to prove x Images B ( 1.1.1.49 ). Images

At the intuitive level, and from the “word description of equality and subset relations”, we expect, for sets A and B , that if A = B , then also A ⊆ B (and by symmetry, also B ⊆ A ). This can be mathematically proved as well: The assumption means (∀ x )( x Images A ≡ x Images B ). Dropping (∀ x ) (Spec) and following up with a tautological implication we get x Images A → x Images B . Reintroducing (∀ x ) (Gen) we get A ⊆ B (Definition (3)).

Images A → x Images B ) and (∀ x )( x Images B → x Images A ), respectively. Dropping (∀ x ) (Spec) we obtain x Images A → x Images B and x Images B → x Images A . Following up with a tautological implication we get x Images A ≡ x Images B . Applying (∀ x ) we get A = B .

So, in practice, to prove set equality, A = B , we go about it like this: “(⊆) direction: Fix x Images A … therefore, x Images B is proved”. Then we do: “(⊇) direction: Fix x Images B … therefore, x Images A is proved”. Images

If A ⊆ B but A ≠ B we say that “ A is a proper subset of B ” and write A ⊂ B . As is usual in mathematics, negating a relation is informally denoted by the relation symbol superimposed with a “/”. So A ∉ B , A ⊈ B and A ⊄ B mean ¬ A Images B , ¬ A ⊆ B and ¬ A ⊂ B , respectively.

1.1.2.2 Definition. (Bounded Quantification) In much of what we do in this volume we will find bounded quantifiers very useful. That is, in set theory we will often want to says things like “for all x in A , Images [ x ] holds”. While this can be captured by (∀ x )( x Images A → Images [ x ]), the alternative shorthand is much in use, and preferable: (∀ x Images A ) Images [ x ] or also (∀ x ) Images A Images [ x ].

In arithmetic we will correspondingly often want to say “for all x < y , Images [ x ] holds”. This is coded directly as (∀ x )( x < y → Images [ x ]). The preferred shorthand is: (∀ x < y ) Images [ x ] or also (∀ x ) < y Images [ x ]. In these two cases, respectively, A and y are free variables. Images

Images [ x ] holds” and “for some x < y , Images [ x ] holds” have the shorthands (∃ x Images A ) Images [ x ] or (∃ x ) Images A Images [ x ] for the former and (∃ x < y) Images [ x ] or also (∃ x ) < y Images [ x ] for the latter.

The shorthand (∃ x Images A ) Images [ x ] and (∃x < y ) Images [ x ] stand for (∃ x ) ( x Images A ⋀ Images [ x ]) and (∃ x )( x < y ⋀ Images [ x ]), respectively.

Translating to ∀ notation we do not get any nasty surprises. For example,

Images

is equivalent to ¬(∀ x )¬( x Images A ⋀ Images [ x ]). Using 1.1.1.53 and an obvious tautology, we see that this is the same as ¬(∀ x )( x Images A → ¬ X [ x ]); in shorthand: ¬(∀ x Images A )¬ X [ x ]. Neat! The original (*) has the bounded-quantifier expression (∃ x Images A ) Images [ x ], so the “∃ ≡ ¬∀¬” property ( 1.1.1.20 ) holds for bounded quantifiers! Images

1.1.2.4 Exercise . Show that the “∀ ≡ ¬∃¬” property ( 1.1.1.21 ) holds for bounded quantifiers.           Images

There is a more general way to build sets than by just collecting together and listing a finite number of elements; by “defining property”. That is, for any formula Images ( x ) we collect into a set all the x (values) for which Images ( x ) is true. We denote this set by the term { x : Images ( x )}. Of course, Images ( x ) is the defining property or “entrance requirement” that determines membership. To make this precise we define

1.1.2.5 Definition . S = { x : Images ( x )} is shorthand, suggestive, notation for (∀ x )( x Images S ≡ Images ( x )).           Images

1.1.2.6 Remark . Several remarks are in order.

(1) The S that enters in (∀ x )( x Images S ≡ Images ( x )) is unique , that is, if also (∀ x )( x Images T ≡ Images ( x )), then S = T . Indeed, the two imply (Spec) x Images S ≡ Images ( x ) and x Images T Images ( x ), thus, x Images S ≡ x Images T by tautological implication. Generalizing we get (∀ x )( x Images S ≡ x Images T ), and hence S = T .

Pause . Why not just say “The two mean S = { x : Images ( x )} and T = { x : Images ( x )}, hence S = T by transitivity of equality"? Images

Because the notation “ S = { x : Images ( x )}” is only shorthand for something else. The symbol of equality “=” is inserted in anticipation , but not due to an a priori knowledge, that it will behave correctly, as equality . Now we know—through the longer argument and post facto—that it was all right to have written “=” after all.

(2) Renaming the bound variable of (∀ x )( x Images S ≡ Images ( x )) into (a new) z we get the equivalent formula (cf. 1.1.1.33 ) (∀ z )( z Images S ≡ Images ( z )). The latter says S = { z : Images ( z )}. So, x (and z ) in { x : Images ( x )} is a bound variable that can be renamed without changing the meaning.

(3) By specializing (∀ x )( x Images S ≡ Images ( x )) we get t Images S ≡ Images ( t ) for any term t . This says what our intuition wants: To test if an object t is in the set S , just test that it passes the entrance requirement: Images ( t ).

Images { x : Images ( x )} iff Images ( t ). Images

(4) It is time to be reminded (this was mentioned in passing earlier) that it is not the case that every formula Images ( x ) leads to a set { x : Images ( x )}. To think so leads to nasty contradictions, as it did in Cantor’s naïve set theory. Examples of formulae that are not set-builders are x ∉ x and x = x (cf. Section 1.3 ).

(5) The statements { x : Images [ x ]} = { x : Images [ x ] } and Images [ x ] ≡ Images [ x ] are equivalent. Indeed, if we assume the first, then by (1) on p. 27 [which is no more than an application of (vi) from 1.1.1.38 ] we get x Images { x : Images [ x ]} ≡ x Images { x : Images [ x ]}, which by (3) above is (replacing equivalents by equivalents) Images [ x ] ≡ Images [ x ]. These steps can be reversed [in this direction Ext is invoked rather than (1) on p. 27 ] to prove the converse.
This is not unexpected at an intuitive level, but it is nice to have it affirmed mathematically: If two “defining properties” are equivalent, then they yield the same result, true or false, on every object we apply them. Thus, precisely the same objects will “pass” each of the two.

(6) { x : Images ( x , y , z , …)} denotes several different sets (modulo the previous warning), one for each choice of the unspecified values y , z , …. These y , z ,…. are called parameters . Images

1.1.2.7 Example . A few paragraphs ago we called the set-building process by defining property “more general” than the process of building sets by grouping members and listing them explicitly between braces { }. Here is why: { a , b } = { x : x = a ⋁ x = b }. This simple “trick” can be applied to any finite set, to represent it by a defining property, namely, the disjunction of atomic formulae of the form x = a for every a that we want to include in the set. Images

Images There is nothing in naïve set theory that helps us argue that the collection of just two objects—the so-called (unordered) pair— is a set (one that does not lead to contradictions, that is). 36 In the naïve approach we take it for granted as a “self evident” fact! Equipped with the hindsight of the early (naïve) set theory paradoxes and their workarounds, we can be content that a pair is so “small” as a collection—just two elements—and is not about to cause any problems. In axiomatic approaches there is an axiom which says that we can indeed form a set of two elements. Images

1.1.2.8 Example. { x : x Images Images ⋀ x > y } consists of all numbers in Images greater than y . That is: y + 1, y + 2, y + 3, … We may also use the (abuse of) notation { x Images Images : x > y} for this set. Images

1.1.2.9 Example. Sometimes we collect more complicated objects than values of variables. For example, { x 2 : x = 2 ⋁ x = 9} is the set {2 2 , 9 2 }, i.e., {4, 81}.

A more complicated example is S = { x + y : 0 < x < y }, where x , y are varying over Images .

(1) Suppose that y is the only a parameter. Then S = { y + 1, y + 2,…, 2y – 1}.

(2) Suppose x is the only a parameter. Then S = {2 x + 1, 2 x + 2, …}. This is all of Images , except the segment from 0 to 2 x .

(3) Suppose neither of x or y are parameters. Then S = {3, 4, 5, …}.

(4) Finally, suppose that both x and y are parameters. Then what S = { x + y : 0 < x < y } denotes is an infinite family of one-element sets, using all the elements of image except 0, 1, 2: {3}, {4}, {5}, …      Images

Images Because of (4) in 1.1.2.6 , mathematicians found a way to limit the size of collections to ensure they are, technically, sets. An easy (but not the only) way to do this is to build any new sets as parts (subsets) of some other set that we have already built.

Thus all our discussions in set theory will have some—usually unspecified, large enough to be useable but not too large to be troublesome; and totally unobtrusive 37 — reference set tucked away somewhere; let us call it U.

This U is our “resource” where we take our set theory objects from, give values to our variables from, and have our quantifiers vary over. Thus, in set naïve theory, when we write (∀ x ) or (∃ x ) we really mean (∀ x Images U ) or (∃ x Images U ), respectively. This reference set that we put aside for a discussion is also called the domain (of discourse ).

In other branches of mathematics whose objects can be collected into a set we are less vague about the reference set; thus the calculus of one variable has Images as its domain, while Peano arithmetic has Images as its domain. Images

It is convenient to have a set with no elements around, the “empty set”. This is the set S given by the condition

image

By (1) in 1.1.2.6 , there is just one set S that satisfies (*), and the symbol reserved for it is Images . That it is a set is not in question as it is far too small! It contains nothing. Indeed, by 3 in 1.1.2.6 ,

image

thus no x passes the entrance test, the later being false for all x . Of course, we can write

image

Images   It is useful to note that for any set A , we have Images ⊆ A . Indeed, this means x Images Images → x Images A . This is true since, by (**), x Images Images is false. Images

If we want to build more complex sets we will do well to devise operations on sets. Thus,

1.1.2.10 Definition. If A and B are sets, then their union , A ⋃ B , is the set { x : x Images A ⋁ x Images B }. image

Images A ⋃ B is formed by emptying the members of A and B in a single {…} “bag”.

The union makes sense even if one or both of A and B stand for atomic elements with no set-theoretic structure, such as numbers. 38 For example, if B is atomic, then x Images B is false, and hence x Images A ⋁ x Images B ≡ x Images A by 1.1.1.14 . That is, A ⋃ B = A in this case. If both A and B are urelements, then A ⋃ B = Images .

The reader may be wondering: Is it not better to not allow things like x Images 2—to make it “illegal”, rather than false? No. For one thing, that would mean that before we build an atomic formula t Images s we would then have to analyze first s to ensure it is not an urelement; betraying that syntax has to be determined, well, syntactically! Secondly, it would require far too many special cases to be considered in all our definitions. Images

Thus the following is true [with or without a leading (∀ x ); cf. 1.1.1.15 ]:

x Images A ⋃ B ≡ x Images A ⋁ x Images B

We can form the union of three sets as either A ⋃ ( B ⋃ C ) or ( A ⋃ B ) ⋃ C . Since x Images A ⋃ ( B ⋃ C ) is equivalent to

Images

and x Images ( A ⋃ B ) ⋃ C is equivalent to

Images

The equivalence of (1) and (2) proves that A ⋃ ( B ⋃ C ) = ( A ⋃ B ) ⋃ C which renders brackets irrelevant in a chain of two ⋃—indeed, in any finite chain of ⋃ by refining the previous argument (e.g., using induction 39 on the number of ⋃ symbols in the chain).

1.1.2.11 Exercise. For any sets A and B , prove A ⋃ B = B ⋃ A .            Images

1.1.2.12 Example . For any set A , we have A ⋃ Images = A . Indeed, this translates to [using 1.1.1.15 to eliminate (∀ x ), and (3) in 1.1.2.6 ]

x Images A ⋁ x ≠ x ≡ x Images A

which is clearly true, since x ≠ x is false (cf. 1.1.1.14 ). image

The “big ⋃” is a very important generalization of union applied to any collection of sets (and/or urelements), not just finitely many.

1.1.2.13 Definition. (Generalized Union) Let S be a set (may contain sets and/or urelements; may be, intuitively, finite or infinite). The symbol Images S denotes the set that we build by emptying the contents of every set in S into a new container.

Mathematically,

Images

That is, an “x” is put into the new container iff we can spot it inside some A , which in turn is in S .                                  Images

We have some special cases of the Images S : If S is a collection of sets A i — { A 0 , A 1 , A 2 , …}—indexed by i Images Images we may write alternatively

Images

More generally, we may have a collection of sets A a indexed by a set I other than Images —e.g., I = Images , I = {2, 3}. We indicate Images S in this case by the alternative

Images

1.1.2.14 Example. Images a Images {2,3} A a = A 2 ⋃ A 3 . Images

1.1.2.15 Definition . If A and B are sets, then their intersection, A ∩ B , is the set { x : x Images A ∧ x Images B }. If A ∩ B = Images then we call A and B disjoint . Images

A ∩ B is formed by emptying only the common members of A and B in a single {…} bag. The intersection makes sense even if one or both of A and B are urelements.

For example, if B is atomic, then x Images B is false, and hence x Images A ∧ x Images B is false 1.1.1.14 . That is, A ∩ B = Images in this case.

1.1.2.16 Definition. (Generalized Intersection) Let S be a set (may contain sets and/or urelements; may be, intuitively, finite or infinite). The symbol image S denotes the set that we build by emptying the contents that are common to every member of S into a new container. Mathematically,

Images

That is, an “x” is put into the new container iff we can spot it inside every A in S . Images

Images   Thus, if a urelement or Images are members of S, then Images S = Images . Images

For this definition too we have some special cases of the Images S : If S is a set of sets { A 0 , A 1 , A 2 , …} we may write alternatively

Images

More generally, we may have a collection of sets A a indexed by a set I other than Images —e.g., I = Images , I = {0, 1, 2, 3, 11}. We indicate Images S in this case by the alternative

Images

1.1.2.17 Example . Images a Images {0,7} A a = A 0 ∩ A 7 . Images

Images    1.1.2.18 Example . What is Images Images ? By 1.1.2.16

Images

that is

Images

Since A Images Images is false, the entire right hand side of ≡ is true. That is, the left hand side is true precisely for every x . Recalling that “every x” means “every x -value in the domain U ”, we have

Images

hence Images Images = U .

Were it not for the “protection” afforded us by the domain , “every x” would mean “everything”, and we cannot form the set of everything !           Images Images

1.1.2.19 Definition . If A and B are sets, then their difference, A – B, is the set { x : x Images A ∧ x ∉ B }. We may also write this as { x Images A : x ∉ B }. If A = U then we write Images for U – B and call it the complement of B . Images

1.1.2.20 Theorem . A – B = A ∩ Images .

Proof . x Images A – B means x Images A ⋀ x ∉ B . Given that x ∉ B ≡ x Images Images , we are done. Images

1.1.2.21 Example . Let us compute { a , b } – { a }. Now, if a = b , then { a, b } = { a }, hence the difference equals Images . So let a ≠ b . We have { a, b } = { x : x = a ⋁ x = b } and { a } = { x : x = a }, thus

image

The reader will have no trouble verifying that, since both x = a ⋁ x = b and ¬ x = a are true in our context, we have

image

Indeed, in the context of { a, b } – { a }, the truth-value of x = a is f and thus the left hand side of ≡ in (2) has the same truth-value as the right hand side—cf. 1.1.1.14 and note the truth-value of, Images ⋀ Images when Images is t and also the truth-value of Images ⋁ Images when Images is f . Therefore the right hand side of (1) simplifies to { x : x = b } [cf. 1.1.2.6 , item (5)], i.e., { b }. This is the difference. Images

Images 1.1.2.22 Example . What conclusions may we draw from the following equality?

Images

Well, we get, first off, that

Images

by an application of Exercise 1.8.4 ( p. 85 ). That is,

{ a } = { A }

hence

Images

This time let’s apply Images to both sides of (1), We get { a, b } = { A, B }, which, by (2), becomes

Images

Applying again Exercise 1.8.4 ( p. 85 ), to the function x – { a } this time, we get via  (3)

Images

If a = b , then the left hand side of (4) is Images , so a = B and therefore

Images

If a ≠ b , then, also a ≠ B (else the right hand side, and hence the left, is Images ). By the previous example, (4) yields { b } = { B } in this case, so we obtain (5) once more.

In summary, (1) implies (2) and (5) . Images Images

1.1.2.23 Definition. (Kuratowski’s Ordered Pair) For any objects x and y (sets or not), we reserve the symbol ( x , y ) as an abbreviation of the set {{ x }, { x , y }}. We call ( x , y ) the ordered pair of x and y . Images

The nomenclature for ( x , y ) stems from the property established in 1.1.2.22 , that

image

that is, order or position matters in the pair. This property is not shared by { a , b } since, by extensionality, { a , b } = { b , a }, as we know. Of course, the converse—that x = X and y = Y implies ( x , y ) = ( X , Y )—is not miraculous at all, and simply follows by two applications of Exercise 1.8.4 , p. 85 : First, ( x , z ) = ( X , z ) and then ( x , y ) = ( X , Y ).

The reader is familiar with ordered pairs from analytic geometry, where ordered pairs of real numbers give the coordinates of points on the Cartesian plane. Indeed, the concept of Cartesian product relies on the ( x , y ) objects.

1.1.2.24 Example . So, (1, 2) ≠ (2, 1) lest 1 = 2. Is (1, 1) = {1}? To ask explicitly, is Images —that is, by extensionality, twice—is Images Not unless {1} = 1, but this cannot be since 1 is an urelement, it has no set-theoretic structure. Images

Images How about

image

in general, for some set A ? We cannot use here a “type” argument as we did above, since both sides of = are of type set.

Can this be? An unfair question this, since naïve set theory cannot resolve it. If we grant (*), then we have A Images A . Well, can this be?

Axiomatic foundations disallow this state of affairs, basing it on an intuitive concept 40 that “sets are formed by stages”, so you can’t have a set (built) before you have (built) its members. A Images A requires the left A being available before the right A is—an untenable proposition. Thus set theorists have adopted an axiom (of foundation ) which precludes bottomless (unfounded) chains such as

… Images d Images c Images b Images a

The impossibility of A Images A follows from this, since otherwise it would lead to … Images A Images A Images A Images A . Images

Ordered triples, quadruples and beyond can be easily defined using the ordered pair as the basic building block:

1.1.2.25 Definition. (Ordered Tuples) We define the symbol image x 1 ,…, x n image , pronounced the ordered n-tuple or just— n -tuple—by two recurrence equations:

image x 1 , x 2 image                = ( x 1 , x 2 )
   and, for n ≥ 2,
image x 1 , …, x n , x n+1 image = ( image x 1 ,…, x n image , x n+1 )

x i is the i -th component of the tuple. image a , b image is also called an 2-tuple (as well as an ordered pair).

We often employ the abbreviation Images for the (ordered) sequence x 1 ,…, x n . The presence of “→“ will not permit the confusion between the sequence Images and the component x n . If the length n is immaterial or known, we may just write Images . Images

Images   The above is a simple recursive or inductive definition . It compactifies and renders finite an infinite-length definition such as:

image x , y image              = ( y , y )
image x , y , z image           = ( image x , y image , z )
image x , y , z , u image       = ( image x , y , z image , u )
image x , y , z , u , w image = ( image x , y , z , u image , w )
                    ⋮

In essence, it finitely describes the “ ⋮ “ above.

This is entirely analogous with loops in programming where a variable-length (and therefore syntactically illegal)—it depends on the value of N—program segment is correctly implemented as a loop; that is, the following, where X ← X + 1 occurs N times

read    N , X
X        ← 0
X        ← X + 1
         ⋮
X        ← X + 1

is captured by this

read    N , X
X        ← 0
repeat N times
{
X       ← X + 1
         }

The reader has seen recursive definitions similar to the one in 1.1.2.25 , for example, the one that defines nonnegative (integer) powers of a non zero real number a by two equations:

a 0 = 1
   and, for n ≥ 0,
a n +1 \= a · a n

Recursive definitions of this and of more general types are reviewed in Section 1.4. Images

1.1.2.26 Exercise . Show that the name ordered (4-) tuple is apt for image x , y , z , w image by showing that image x , y , z , w image = image X, Y, Z, W image implies that x = X , y = Y , z = Z and w = W . Images

1.1.2.27 Exercise . Write down explicitly the set for which the tuple image x , y , z , w image is compact notation . Images

1.1.2.28 Definition. (Cartesian Product) Let A 1 ,…, A n be sets. Then their Cartesian product, in the given order , is the set

Images

We will employ the symbols

Images

as alternative shorthands for this product.

If A 1 = A and A 2 = B then we write A × B rather than Images . It is all right, but sloppy, to write A 1 × … × A n for the general case. If A i = C , for all i , then we write C n for Images .       image

1.1.2.29 Example . {1} × {2} = { image 1,2 image } and {2} × {1} = { image 2, 1 image }. Thus {1} × {2} ≠ {2} × {1} ; the Cartesian product is not commutative in general.       image

Images    Images can be given by a simple recursive (inductive) definition:

Images
   and, for n ≥ 1,
Images

The reader should verify that this is consistent with 1.1.2.28 and 1.1.2.25 .

Similarly, A n can be defined inductively (recursively) as

A 1 = A
   and, for n ≥ 1,
A n +1 \= A n × A
Images

1.1.2.30 Example . A × Images = Images , since image x , y image Images A × Images is equivalent to x Images A ⋀ y Images Images , which is false. Similarly, Images × A = Images . Images

We conclude our review of set operations with the power set.

1.1.2.31 Definition. (Power Set) For any set A , its power set —denoted as Images ( A ) or 2 A —is { x : x ⊆ A }. Images

1.1.2.32 Example . Thus, 2 Images = { Images }; 2 { Images } \= { Images , { Images }}; and 2 { Images ,{ Images }} \= { Images , { Images }, { Images }}, { Images , { Images }}}.
        2 {0,1} = { Images ,{0},{1},{0,1}}.

Since Images ⊆ A and A ⊆ A for any set A , we have always Images Images 2 A and A Images 2 A .       Images

1.1.3 Alphabets, Strings and Languages

A string or expression or a word is just a tuple, all of whose components come from the same set, A , the latter being called the alphabet . We say that “ x is a string of length n over the alphabet A ” meaning x Images A n .

Traditionally, strings are written down without separating commas or spaces, nor with enclosing angular brackets. So if A = { a , b } we will write aababa rather than image a , a , b , a , b , a image .

Concatenation of image a 1 ,…, a m image and image b 1 ,…, b n image in that order, denoted as

image a 1 ,…, a m image * image b 1 ,…, b n image

is the string of length m + n

image a 1 ,…, a m , b 1 …, b n image

Clearly, concatenation as defined above is associative , that is, for any strings x , y and z we have ( x * y ) * z = x * ( y * z ).

It is convenient to introduce a null or empty string, that has no members, and hence has length 0. We will denote it by ∊. We will not attempt to give it a precise tuple counterpart, but some people write “ Images Images ” with nothing between brackets.

At the intuitive level, and given how concatenation was defined, we see that x * ∊ = ∊ * x = x for any string x . We will distinguish Images and ∊ since one is an “unordered set” will the other is ordered; but both are empty.

The set of all strings of non zero length over a is denoted by A + . This is, of course,

Images

Adding ∊ to the above we get the unqualified set of all strings over A , denoted by A *; that is, A * = A + ⋃ {∊}. This set is often called the Kleene star of A .

A string A is a prefix of a string B if there is a string C such that B = A * C . It is a suffix of B if for some D , we have B = D * A . The prefix (suffix) is proper if it is not equal to B.

Images Just as we use implied multiplication , ab for a × b or a · b , we also use implied concatenation , xy for x * y —leaving it up to the context to fend off ambiguities. Images

1.1.3.1 Example . Not all alphabets are amenable to writing tuples in “string-notation”. For example, A = {1, 11} has a problem. The notation 111 is ambiguous: Do we mean image 1, 1, 1 image , image 11, 1 image , or image 1, 11 image ?           Images

1.1.3.2 Definition. (Languages) A language, L , over an alphabet A is just a subset of A *. Images

The “interesting” languages are those that are finitely definable. Automata and language theory studies the properties of such finitely definable languages and of the “machinery” that effects these finite definitions.

1.1.3.3 Definition. (Concatenation of Languages) If L and M are two languages over an alphabet A , then the symbol L * M or simply (implied concatenation) LM means the set { xy : x Images L ⋀ y Images M } Images .

Images One can learn to live with * as both a unary (one-argument) operation, A *, and as a binary one, L * M , much the same way we can see no ambiguity in uses of minus as –x and y – z . Images