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).
Since a set is itself an object , a set may contain sets as elements.
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 .
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 .
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 (
) 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
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.
1.1.1.1 Definition. The simplest possible relations of set theory are of just two forms : t
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.
1.1.1.2 Example. x
y , u = v , z
S and 3
z and 2 z = y 3 are atomic formulae.
, 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.
By “
... is an important constant” we mean, of course, via the habitual abuse of language exercised by mathematicians, the accurate “
... denotes (or names ) an important constant”.
Here is an example that uses
in an atomic formula: −7
. Incidentally, this formula makes (i.e., encodes) a false statement; we say the formula is false .
One may form this basic formula as well,
, where the meaning of the symbols “{...}” and “
” will be introduced later in this section.
Yet another example is {1}
{2, 1}—a false statement (formula) as we will be able to determine soon.
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
∀, ∃
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,
and x y z u — axiomatic set theory needs no a priori existence of any objects. Starting just with the relations x
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.
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 .
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.
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
,
,
,
.
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, +,
) 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) (¬
), where
is known to be 16 a formula.
(3) (
∧
), where
and
are known to be formulae.
(4) (
∨
), where
and
are known to be formulae.
(5) (
→
), where
and
are known to be formulae.
(6) (
≡
), where
and
are known to be formulae.
(7) ((∀ x )
), where
is known to be a formula and x is any variable.
(8) ((∃ x )
), where
is known to be a formula and x is any variable. We say in the last two cases that “
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 (∃).
1.1.1.4 Definition. (Immediate Predecessors) Let
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
and
[the latter enters in cases (3)–(6)] that were used to build it. We use the acronym ip for immediate predecessors .
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.
1.1.1.5 Example. Here are some formulae:
x
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
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 .
1.1.1.6 Remark. (Building a formula) If
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
. Flag it pending .
Repeat this process until it cannot be carried further :
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.
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
by repeated application of Definition 1.1.1.3 . This top-down view of our “deconstruction” is a formula-construction sequence for
.
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).
A term such as x 2 has x as its only input variable. An atomic formula such as z
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
we will write t ( x , u , S , z ) or
( 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.
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.
1.1.1.9 Definition. (Input Variables—in Formulae) A variable occurrence 17 in an atomic formula t
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
{ 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
and
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
( x , y , z ), of inputs x , y , z , the new formula (( Qy )
( x , y , z )), where Q stands here for one of ∀, ∃, has only x and z as input variables.
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:
i means 1 + 2 + 3. While we can “see” the variable i , it is not really there! 18 It cannot accept inputs. For example, “
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) .
If
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
( x , y , z , ...). If x , y , z , ... is a list of variables such that some 19 among them occur in
, then we indicate this by
[ x , y , z , ...].
In the context of
[ x , y , z , ...] [or
( x , y , z , ...)],
[ t 1 , t 2 , t 3 , ...] [correspondingly
( t 1 , t 2 , t 3 , ...)] stands for the formula obtained from
by replacing each original occurrence of x , y , z , ... in
by the terms t 1 , t 2 , t 3 , ... respectively.
Some people call this operation simultaneous or parallel substitution. Thus, if
[ x , y ] names “ x = y ”, whereas t 1 is y + 1, and t 2 is 5, then
[ 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”.
Observe also that if x does not occur in
[ x ], then
[ t ] is just the original
.
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”.
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
has already in place all the brackets that are prescribed by Definition 1.1.1.3 , then ... →
∨
means ... →
∨
, while ... ¬
∧
means ...
¬
∧
.
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
has all the brackets prescribed by Definition 1.1.1.3 in place, then ... →
→
means ... →
→
.
Similarly, if any of ¬, ∀, ∃ compete for a part of a formula, again the one to the right wins. E.g., ... ¬(∀ x )(∃ y )
means ...
, where once again we assumed that
has all the brackets prescribed by Definition 1.1.1.3 already in place.
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
—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 .
1.1.1.10 Remark. The mathematician’s intuitive understanding of the statement “
is true (resp. false )” is that “
is true (resp. false) for all the possible values of the free (input) variables of
”.
Thus, if we are working in arithmetic, “2 n + 1 is odd” means the same thing as “it is true that, for all n
, 2 n + 1 is odd”. “2 n > n ” again omits an implied prefix “it is true that, for all n
”. An example of a false statement with input variables is “2 n is odd”.
1.1.1.11 Definition. An instance of a formula
, in symbols
′, is a formula obtained from
by replacing each of its variables by some value from the relevant reference set.
Clearly,
′ 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
( x , y , z , ...) or of
[ x , y , z , ...] is
( i , j , k , ...) or
[ i , j , k , ...], respectively, where i , j , k , ... are objects (constants) from the reference set.
′ and
′ are consistent or common instances of
and
if every free variable that appears in both of the latter receives the same value in both instances.
1.1.1.12 Example. Let
stand for “ x ( x + 1) is even”,
stand for “2 x + 1 is even” and
stand for “ x is even”, where x is a variable over
. Then,
is true,
is false, and
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 .
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
∨
, ((∀ x )
), etc., passes through the semantics of arbitrary instances of these; namely, we need to only define the meaning of
′ ∨
′, ((∀ x )
)′, etc., respectively.
1.1.1.13 Definition. (Computing with Connectives and Quantifiers) Let
and
be any formulae, and
′ and
′ be arbitrary common instances ( 1.1.1.11 ).
(1) ¬
′—pronounced “not
′”—is true iff 21
′ is false.
(2)
′ ∨
′—pronounced “
′ or
′”—is true iff either
′ is true or
′ is true, or both (so-called inclusive or ).
(3)
′ ∧
′—pronounced “
′ and
′”—is true iff
′ is true and
′ is true.
(4)
′ →
′—pronounced “if
′, then
′”—is true iff either
′ is false or
′ is true, or both . 22
(5)
′ ≡
′—pronounced “
′ iff
′”—is true just in case 23
′ and
′ are both true or both false.
(6) The instance (∀ x )
( i 1 , ..., i m , x , j 1 , ..., j n )—which is pronounced “for all x ,
( i 1 , ..., i m , x , j 1 , ..., j n ) (holds)” 24 — is true iff, for all possible values k of x from the domain,
( i 1 , ..., i m , k , j 1 , ..., j n ) is true.
(7) The instance (∃ x )
( i 1 , ..., i m , x , j 1 , ..., j n ) —which is pronounced “for some x ,
( i 1 , ..., i m , x , j 1 , ..., j n ) (holds)”—is true iff, for some value k of x from the domain,
( i 1 , ..., i m , k , j 1 , ..., j n ) is true.
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):
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
and
. Third, below ¬
,
∨
, etc., we list the computed truth-values (of the formulae of the first row) that correspond to the assumed
and
values.
The odd alignment under ¬
is consistent with all the others: It emphasizes the placement of the “result” under the “operator”—here ¬—that causes it.
1.1.1.15 Remark. According to Remark 1.1.1.10 ,
means precisely this:
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,
( i 1 , ..., i m , k , j 1 , ..., j n ) is true
The above, and hence also (†), translate via Remark 1.1.1.10 as
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
. 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?
1.1.1.16 Example. We note easily that, say, with
(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.
Carrying around the predicate “is true” all the time is annoying. We will adopt immediately the mathematician’s jargon: Simply stating “
( x , y , ...)” is synonymous to “
( x , y , ...) is true” or “
( x , y , ...) holds”.
1.1.1.17 Example. Let
be our domain. Then,
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
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
is true” (where
is any formula)?
(∃ x )
[ x ] ∧ ¬(∃ z ) (
[ z ] ∧ x ≠ z )
Fortunately, there is a short form for the above (∃! reads “for some unique”)
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
→
is the same as (has the same meaning as) ¬
∨
. Similarly,
≡
is the same as (
→
) ∧ (
→
).
Even
∧
can be expressed via ¬ and ∨ as ¬(¬
∨
). This is easiest to see, perhaps, via a truth-table:
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
∧
and ¬(¬
∨
) yield the same output for any given value-pair of
and
. Thus we proved the equivalence of the
∧
and ¬(¬
∨
). This result is known as “de Morgan’s Law”.
1.1.1.19 Exercise. Prove that
∨
can be expressed as ¬(¬
∧
). This is the “other” (technically dual of) de Morgan’s Law.
1.1.1.20 Example. We know [(7) of Definition 1.1.1.13 ] that (∃ x )
( z 1 , ..., z m , x , y 1 , ..., y n ) means
Now, the negation of “there is a k such that
( i 1 , ..., i m , k , j 1 , ..., j n )” is
that is,
(2) says the same thing as
(1.2) – (1.3) , (1), and (3) yield (via 1.1.1.13 )
(∃ x )
( i 1 , ..., i m , k , j 1 , ..., j n ) ≡ ¬(∀ x )¬
( i 1 , ..., i m , x , j 1 , ..., j n )
By (1.1) and 1.1.1.10 , we have
(∃ x )
( z 1 , ..., z m , x , y 1 , ..., y n ) ≡ ¬(∀ x )¬
( z 1 , ..., z m , x , y 1 , ..., y n )
for short
1.1.1.21 Exercise. Prove that (∀ x )
≡ ¬(∃ x )¬
.
1.1.1.22 Remark. We note that
→
is true, in particular, when no instance of
is true, i.e., when
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
and
at all and even if
is not true! For example, if
is 0 ≠ 0 and
is “in every Euclidean triangle the sum of the angles equals 9 π ”, then (
→
) is true. The same holds if
stands for “ n is even”. The latter has both true and false instances over
, but that is immaterial. In each chosen instance,
′ →
′ is true—that is ( 1.1.1.10 ),
→
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
→
where
is 0 = 0 and
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
→
, connects the hypothesis
strongly to the conclusion
. The meaning, informally speaking, is that, from a proof (intuitionistic proof, of course!) of
, a proof for
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
and
must be related before the Intuitionist will agree to write
→
.
In particular, in intuitionistic logic → and ∨ do not relate as in 1.1.1.18 above. In fact, in both logics
→
holds, however, in intuitionistic logic
∨ ¬
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
∨
holds, in general you need to construct a proof of one of
or
.
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 =
. If this works, done. If not, that means that
is irrational .
Well, then take a =
and b =
. Now a b =
=
2 = 2. A rational. End of proof.
Above,
is “
is rational” and
is “
is irrational”. We used the (classical) fact that
∨
is true, since one or the other of
and
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ü]).
1.1.1.23 Example. Suppose that x does not occur free in
[ x ].
Pause. Ensure that this is consistent with the notation introduced in Definition 1.1.1.11 .
Then
Indeed, let y , z , w , ... be the complete list of free variables of
, 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
that is,
We need to analyze (∀ x )
[ x , k , l , m , ...]. It says
“for all n in the domain,
[ n , k , l , m , ...] is true”
But this is true exactly when
( k , l , m , ...) is, since n does not affect the output: the variable x is non-input in
.
1.1.1.24 Exercise. Suppose we drop the condition “suppose that x does not occur free in
[ x ]” above. Does (1) still hold? You must provide the “why”!
1.1.1.25 Exercise. In view of 1.1.1.15 , “
[ x ] is true” iff “(∀ x )
[ x ] is true”. So, is this observation not all that we need to assert (1)? See also the previous exercise.
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
—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
.
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.
Double-boundary boxes enclose maximal prime formulae. The Boolean structure of (1) is
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).
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 !
We indicate this fact by writing
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 ).
1.1.1.28 Example. Some tautologies: x = 0 → x = 0, (∀ x )
∨ ¬(∀ x )
, 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.
1.1.1.29 Definition. (Tautological Implication) We say that
1 , ...,
n tautologically imply
iff ⊨ taut
1 →
2 → ... →
n →
.
We write
1 , ...,
n ⊨ taut
in this case.
, we say, is (the result of) a tautological implication from
1 , ...,
n .
1.1.1.30 Remark. We note that a tautological implication preserves truth, from left to right. See exercise below.
1.1.1.31 Exercise. Let p 1 , ..., p m be all the Boolean variables that appear in the formulae
1 , ...,
n ,
.
Show that
1 , ...,
n ⊨ taut
iff every set of values assigned to the Boolean variables that makes all the
i t , also makes
t .
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
∨ ¬
(no matter what
stands for).
⊨ taut
→
is also correct, since
→
→
, that is,
→ (
→
) 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
. 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.
1.1.1.33 Remark. (Capture of a Free Variable) Let
( 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
, this is clearly a true statement. So is
( Z ), obtained by substituting z for x , or, in programming jargon, “calling”
( x ) with argument z .
What about
( 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
( 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
[ x ] that results into
[ 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 )
( i 1 , ..., i m , x , j 1 , ..., j n ) of
and a consistent instance (cf. 1.1.1.11 ) (∃ u )
( i 1 , ..., i m , u , j 1 , ..., j n ) of
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 )
( z 1 , ..., z m , x , w 1 , ..., w n ) ≡ (∃ u )
( 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
[ x ], we can always effect
[ 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
[ t ] we do not have the original formula
, 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,
.
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 )
(..., x , ...) provided
(..., x , ...) has already been written in the course of the proof.
Any formula
that appears in a proof we call a theorem. We say that the proof “established” or proved the theorem
.
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 .
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
-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 )
[ x ] →
[ t ] are such universal truths, and we will adopt both as logical axioms.
(b) A formula
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
. There is nothing to render it “universal”; in fact, it is not a true statement if our domain is either the reals,
, or the integers,
(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 “
is true in the theory ” simply means that
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
is true in a theory Σ will be denoted symbolically as Σ ⊢
.
Note that the logical axioms are not mentioned at the left of “⊢”. Thus, if Σ is empty and we have proved
only using logical axioms, then we will write ⊢
.
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
for which ⊢
. 31
It is clear that ⊢ is transitive, that is, if we have Σ ⊢
i for i = 1, ..., n , and also A 1 , ..., A n ⊢
, then Σ ⊢
. Indeed, we can clearly concatenate the proofs of each A i —in any order—and then append the proof of
at the very end. What we get is a proof of
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.
1.1.1.36 Exercise. Elaborate on the remark above regarding the transitivity of ⊢.
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 .
Since rules (2) and Gen on 1.1.1.34 preserve truth, and the logical axioms are universally true, then so is any
for which we have ⊢
. Logicians call the content of this observation soundness .
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 )
[ x ] →
[ t ] (see conclusion of 1.1.1.33 )
(iii)
[ x ] → (∀ x )
[ x ], provided x is not free in
[ x ]
(iv) (∀ x )(
[ x ] →
[ x ]) → (∀ x )
[ x ] → (∀ x )
[ x ]
(v) x = x
(vi) t = s → (
[ t ] ≡
[ s ]) (see conclusion of 1.1.1.33 ).
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)].
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
[ 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
[ 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 )(
( x ) →
( x )) → (∀ x )
( x ) → (∀ x )
( x ) in its domain. First off, this means
Since (1) is an implication, 1.1.1.14 indicates that the only real work for us is if (∀ x )(
( x ) →
( x )) evaluates as t . If this is so, this means
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 )
( x ) is true, that is
For every k in the domain,
( k ) is t (3)
and try to obtain that
is true. Now, via 1.1.1.14 , (2) and (3) give “For every k in the domain,
( k ) is t ”, which establishes (4).
1.1.1.40 Example. Here are some proofs written in extreme pedantry. (I) Establish the (universal) truth of
[ t ] → (∃ x )
[ x ]. The proof follows:
(1) (∀ x )¬
[ x ] → ¬
[ t ] 〈 axiom (ii)〉
(2)
[ t ] → ¬(∀ x )¬
[ x ] 〈(1) and rule (2) of proof-writing; 1.1.1.34 〉
(3)
[ t ] → (∃ x )
[ 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”
→
with inputs, first ¬(∀ x )¬
[ x ] and then (∃ x )
[ 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〉
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 )
[ x ] follows (the truth of)
[ t ]”. This rule is called specialization or Spec. It follows from an application of this tautological implication,
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 ).
1.1.1.42 Exercise. Give a proof that from the truth of
[ x ] follows the truth of
[ t ].
1.1.1.43 Example. We verify that with an assumption (nonlogical!) of the form
→
we can prove
→ (∀ x )
, on the proviso that x is not free in
. That is, we verify, under the stated condition, that
→
⊢
→ (∀ x )
.
(1)
→
〈hyp〉
(2) (∀ x )(
→
) 〈(1) + Gen〉
(3) (∀ x )(
→
) → (∀ x )
→ (∀ x )
〈axiom (iv)〉
(4) (∀ x )
→ (∀ x )
〈(2, 3) + MP〉
(5)
→ (∀ x )
〈(*)〉
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
→
⊢ ¬
→ ¬
. The two sides of ⊢ are called contrapositives of each other.
1.1.1.45 Exercise. Prove that
→
⊢ (∃)
→
as long as x is not free in
. Hint. Rely on 1.1.1.44 and use 1.1.1.43 .
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
[ z ] stand for z = x. An instance of Leibniz’s axiom is x = y → (
[ x ] ≡
[ 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 .
1.1.1.48 Example. There are a couple of trivial, but often-used proof tools. They are expressed in the form
,
, …⊢
, that is, “if I know that
,
, …hold—either because they are assumptions (e.g., could be nonlogical axioms) or are already proved theorems—then I can prove that
holds as well”.
(a) Proof by cases.
→
,
→
⊢
∨
→
.
It states that to prove that
follows from a disjunction, it suffices to prove separately that
follows from each case—
and
—of the disjunction.
(b) Ping pong.
→
,
→
⊢
≡
. It states that to prove an equivalence,
≡
, it suffices to prove each direction —
→
and
→
—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].
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.
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.
1.1.1.49 Theorem. (Deduction Theorem) If we can prove
from assumptions Γ and
then we can prove
→
from the assumptions Γ alone, on a condition. The condition is that during the proof of
from hypotheses Γ and
, step (3) of 1.1.1.34 was never applied with a variable that occurs free in
.
In other words, the free variables of
during said proof are “frozen”; they behave like constants .
We can say the above symbolically as “if Γ,
⊢
, then Γ ⊢
→
, on a condition, etc.”
What is the deduction theorem good for? Well, for one thing, it tells us that instead of proving
→
it suffices to prove the less complex—since the glue → and the part
are removed—
. For another, we have the added bonus of “knowing more” before starting the proof. While toward proving
→
we “knew” Γ, toward proving
we also know
.
Is the restriction on
too limiting? Not really. In practice, say, we want to prove that Γ ⊢
( x , y )→
( z , y , w ). We proceed as follows:
Fix all the variables of
, 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( x , y ). Proceed to prove
( z , y , w )—recall that y is a “constant".
By the deduction theorem, we have proved( x , y ) →
( 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
”.
We are, of course, obliged to remember that this also fixes these same variables in
, 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
.
We do not need to repeat this kind of justification every time: “By the deduction theorem, we have proved
→
from just Γ, etc.”
We will see this proof technique applied many times in this book, starting from the next subsection.
∧¬
. From the truth tables we know that this evaluates as f regardless of whether
itself evaluates a t or f. The reader can verify at once, that for any
,
∧¬
⊨ taut
.
1.1.1.50 Theorem. (Proof by Contradiction) For any closed
, we have Γ ⊢
iff Γ, ¬
⊢
∧¬
, for some
.
Proof. Indeed, for the if -part, let Γ, ¬
⊢
∧¬
. By the deduction theorem (applicable without hedging as
is closed) we get
Γ ⊢ ¬
→
∧¬
(1)
It is straightforward to see that ¬
→
∧¬
⊨ taut
, hence by transitivity of ⊢, we get Γ ⊢
.
only if -part. Say, Γ ⊢
. Adding to the assumptions Γ we can still prove
(see that you agree! 1.1.1.34 ). Thus
Γ, ¬
⊢
(2)
But also (why?)
Γ, ¬
⊢¬
(3)
The trivial
,¬
⊨ taut
∧¬
along with (2) and (3) above, and transitivity of ⊢, yield Γ, ¬
⊢
∧ ¬
.
(closed
) we start by “Assume, by way of contradiction, ¬
” and then proceed to indeed obtain one.
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.
Thus we can rephrase 1.1.1.50 as Γ ⊢
iff (the theory with axioms) Γ, ¬
is inconsistent.
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 )(
∧
) ≡ (∀ x )
∧ (∀ x )
Proof. We employ ping pong. (→) direction: Assume (∀ x )(
∧
) with all its free variables frozen (we are going via the deduction theorem). Remove the quantifier (Spec) to obtain
∧
and apply two tautological implications to obtain
and
Apply Gen to each to get (∀ x )
and (∀ x )
. A tautological implication yields what we want.
For the (←) direction, assume (∀ x )
∧ (∀ x )
, freezing all free variables of the formula. Two tautological implications yield (∀ x )
and (∀ x )
. Two applications of Spec, followed by tautological implication yield
∧
. Via Gen we get what we want.
(3) We finally establish that
→
⊢ (∀ x )
→ (∀ x )
. Indeed, the hypothesis yields (∀ x ) (
→
) by Gen. We are done via axiom (iv) ( 1.1.1.38 ) and modus ponens.
1.1.1.53 Exercise . Establish the fact
≡
⊢ (∀ x )
≡ (∀ x )
.
Hint. Use 1.1.1.52 .
1.1.1.54 Exercise . Establish the fact
≡
⊢ (∃ x )
≡ (∃ x )
.
Hint. Use 1.1.1.53 .
1.1.1.55 Exercise . Establish the fact ⊢ (∃ x )(
⋁
) ≡ (∃ x )
⋁ (∃ x )
.
Hint. Use 1.1.1.52 .
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
A and x
B. By 1.1.1.38 (vi), we obtain 34
A = B → ( x
A ≡ x
B )
and further, via 1.1.1.43 we get (since x , A , B are distinct variables)
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 .
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 ]:
Since x
2 and x
3 are false, as 2 and 3 are numbers and thus contain no elements,
(∀ x )( x
2 ≡ x
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 .
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
= {0, 1, 2, ...} is not a by-listing depiction of
, 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.
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:
A → x
B ). But to so prove, it suffices to prove instead x
A → x
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
A ”. All that one needs to do next is to prove x
B ( 1.1.1.49 ).
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
A ≡ x
B ). Dropping (∀ x ) (Spec) and following up with a tautological implication we get x
A → x
B . Reintroducing (∀ x ) (Gen) we get A ⊆ B (Definition (3)).
A → x
B ) and (∀ x )( x
B → x
A ), respectively. Dropping (∀ x ) (Spec) we obtain x
A → x
B and x
B → x
A . Following up with a tautological implication we get x
A ≡ x
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
A … therefore, x
B is proved”. Then we do: “(⊇) direction: Fix x
B … therefore, x
A is proved”.
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
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 ,
[ x ] holds”. While this can be captured by (∀ x )( x
A →
[ x ]), the alternative shorthand is much in use, and preferable: (∀ x
A )
[ x ] or also (∀ x )
A
[ x ].
In arithmetic we will correspondingly often want to say “for all x < y ,
[ x ] holds”. This is coded directly as (∀ x )( x < y →
[ x ]). The preferred shorthand is: (∀ x < y )
[ x ] or also (∀ x ) < y
[ x ]. In these two cases, respectively, A and y are free variables.
[ x ] holds” and “for some x < y ,
[ x ] holds” have the shorthands (∃ x
A )
[ x ] or (∃ x )
A
[ x ] for the former and (∃ x < y)
[ x ] or also (∃ x ) < y
[ x ] for the latter.
The shorthand (∃ x
A )
[ x ] and (∃x < y )
[ x ] stand for (∃ x ) ( x
A ⋀
[ x ]) and (∃ x )( x < y ⋀
[ x ]), respectively.
Translating to ∀ notation we do not get any nasty surprises. For example,
is equivalent to ¬(∀ x )¬( x
A ⋀
[ x ]). Using 1.1.1.53 and an obvious tautology, we see that this is the same as ¬(∀ x )( x
A → ¬ X [ x ]); in shorthand: ¬(∀ x
A )¬ X [ x ]. Neat! The original (*) has the bounded-quantifier expression (∃ x
A )
[ x ], so the “∃ ≡ ¬∀¬” property ( 1.1.1.20 ) holds for bounded quantifiers!
1.1.2.4 Exercise . Show that the “∀ ≡ ¬∃¬” property ( 1.1.1.21 ) holds for bounded quantifiers.
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
( x ) we collect into a set all the x (values) for which
( x ) is true. We denote this set by the term { x :
( x )}. Of course,
( x ) is the defining property or “entrance requirement” that determines membership. To make this precise we define
1.1.2.5 Definition . S = { x :
( x )} is shorthand, suggestive, notation for (∀ x )( x
S ≡
( x )).
1.1.2.6 Remark . Several remarks are in order.
(1) The S that enters in (∀ x )( x
S ≡
( x )) is unique , that is, if also (∀ x )( x
T ≡
( x )), then S = T . Indeed, the two imply (Spec) x
S ≡
( x ) and x
T
( x ), thus, x
S ≡ x
T by tautological implication. Generalizing we get (∀ x )( x
S ≡ x
T ), and hence S = T .
Pause . Why not just say “The two mean S = { x :
( x )} and T = { x :
( x )}, hence S = T by transitivity of equality"?
Because the notation “ S = { x :
( 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
S ≡
( x )) into (a new) z we get the equivalent formula (cf. 1.1.1.33 ) (∀ z )( z
S ≡
( z )). The latter says S = { z :
( z )}. So, x (and z ) in { x :
( x )} is a bound variable that can be renamed without changing the meaning.
(3) By specializing (∀ x )( x
S ≡
( x )) we get t
S ≡
( 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:
( t ).
{ x :
( x )} iff
( t ).
(4) It is time to be reminded (this was mentioned in passing earlier) that it is not the case that every formula
( x ) leads to a set { x :
( 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 :
[ x ]} = { x :
[ x ] } and
[ x ] ≡
[ 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
{ x :
[ x ]} ≡ x
{ x :
[ x ]}, which by (3) above is (replacing equivalents by equivalents)
[ x ] ≡
[ 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 :
( 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 .
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.
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.
1.1.2.8 Example. { x : x
⋀ x > y } consists of all numbers in
greater than y . That is: y + 1, y + 2, y + 3, … We may also use the (abuse of) notation { x
: x > y} for this set.
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
.
(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
, 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
except 0, 1, 2: {3}, {4}, {5}, …
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
U ) or (∃ x
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
as its domain, while Peano arithmetic has
as its domain.
It is convenient to have a set with no elements around, the “empty set”. This is the set S given by the condition
By (1) in 1.1.2.6 , there is just one set S that satisfies (*), and the symbol reserved for it is
. 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 ,
thus no x passes the entrance test, the later being false for all x . Of course, we can write
It is useful to note that for any set A , we have
⊆ A . Indeed, this means x
→ x
A . This is true since, by (**), x
is false.
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
A ⋁ x
B }.
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
B is false, and hence x
A ⋁ x
B ≡ x
A by 1.1.1.14 . That is, A ⋃ B = A in this case. If both A and B are urelements, then A ⋃ B =
.
The reader may be wondering: Is it not better to not allow things like x
2—to make it “illegal”, rather than false? No. For one thing, that would mean that before we build an atomic formula t
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.
Thus the following is true [with or without a leading (∀ x ); cf. 1.1.1.15 ]:
x
A ⋃ B ≡ x
A ⋁ x
B
We can form the union of three sets as either A ⋃ ( B ⋃ C ) or ( A ⋃ B ) ⋃ C . Since x
A ⋃ ( B ⋃ C ) is equivalent to
and x
( A ⋃ B ) ⋃ C is equivalent to
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 .
1.1.2.12 Example . For any set A , we have A ⋃
= A . Indeed, this translates to [using 1.1.1.15 to eliminate (∀ x ), and (3) in 1.1.2.6 ]
x
A ⋁ x ≠ x ≡ x
A
which is clearly true, since x ≠ x is false (cf. 1.1.1.14 ).
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
S denotes the set that we build by emptying the contents of every set in S into a new container.
Mathematically,
That is, an “x” is put into the new container iff we can spot it inside some A , which in turn is in S .
We have some special cases of the
S : If S is a collection of sets A i — { A 0 , A 1 , A 2 , …}—indexed by i
we may write alternatively
More generally, we may have a collection of sets A a indexed by a set I other than
—e.g., I =
, I = {2, 3}. We indicate
S in this case by the alternative
1.1.2.14 Example.
a
{2,3} A a = A 2 ⋃ A 3 .
1.1.2.15 Definition . If A and B are sets, then their intersection, A ∩ B , is the set { x : x
A ∧ x
B }. If A ∩ B =
then we call A and B disjoint .
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
B is false, and hence x
A ∧ x
B is false 1.1.1.14 . That is, A ∩ B =
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
S denotes the set that we build by emptying the contents that are common to every member of S into a new container. Mathematically,
That is, an “x” is put into the new container iff we can spot it inside every A in S .
Thus, if a urelement or
are members of S, then
S =
.
For this definition too we have some special cases of the
S : If S is a set of sets { A 0 , A 1 , A 2 , …} we may write alternatively
More generally, we may have a collection of sets A a indexed by a set I other than
—e.g., I =
, I = {0, 1, 2, 3, 11}. We indicate
S in this case by the alternative
1.1.2.17 Example .
a
{0,7} A a = A 0 ∩ A 7 .
1.1.2.18 Example . What is
? By 1.1.2.16
that is
Since A
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
hence
= 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 !
1.1.2.19 Definition . If A and B are sets, then their difference, A – B, is the set { x : x
A ∧ x ∉ B }. We may also write this as { x
A : x ∉ B }. If A = U then we write
for U – B and call it the complement of B .
1.1.2.20 Theorem . A – B = A ∩
.
Proof . x
A – B means x
A ⋀ x ∉ B . Given that x ∉ B ≡ x
, we are done.
1.1.2.21 Example . Let us compute { a , b } – { a }. Now, if a = b , then { a, b } = { a }, hence the difference equals
. So let a ≠ b . We have { a, b } = { x : x = a ⋁ x = b } and { a } = { x : x = a }, thus
The reader will have no trouble verifying that, since both x = a ⋁ x = b and ¬ x = a are true in our context, we have
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,
⋀
when
is t and also the truth-value of
⋁
when
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.
1.1.2.22 Example . What conclusions may we draw from the following equality?
Well, we get, first off, that
by an application of Exercise 1.8.4 ( p. 85 ). That is,
{ a } = { A }
hence
This time let’s apply
to both sides of (1), We get { a, b } = { A, B }, which, by (2), becomes
Applying again Exercise 1.8.4 ( p. 85 ), to the function x – { a } this time, we get via (3)
If a = b , then the left hand side of (4) is
, so a = B and therefore
If a ≠ b , then, also a ≠ B (else the right hand side, and hence the left, is
). By the previous example, (4) yields { b } = { B } in this case, so we obtain (5) once more.
In summary, (1) implies (2) and (5) .
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 .
The nomenclature for ( x , y ) stems from the property established in 1.1.2.22 , that
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
—that is, by extensionality, twice—is
Not unless {1} = 1, but this cannot be since 1 is an urelement, it has no set-theoretic structure.
How about
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
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
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
…
d
c
b
a
The impossibility of A
A follows from this, since otherwise it would lead to …
A
A
A
A .
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
x 1 ,…, x n
, pronounced the ordered n-tuple or just— n -tuple—by two recurrence equations:
x 1 , x 2
= ( x 1 , x 2 )
and, for n ≥ 2,
x 1 , …, x n , x n+1
= (
x 1 ,…, x n
, x n+1 )
x i is the i -th component of the tuple.
a , b
is also called an 2-tuple (as well as an ordered pair).
We often employ the abbreviation
for the (ordered) sequence x 1 ,…, x n . The presence of “→“ will not permit the confusion between the sequence
and the component x n . If the length n is immaterial or known, we may just write
.
The above is a simple recursive or inductive definition . It compactifies and renders finite an infinite-length definition such as:
x , y
= ( y , y )
x , y , z
= (
x , y
, z )
x , y , z , u
= (
x , y , z
, u )
x , y , z , u , w
= (
x , y , z , u
, 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.
1.1.2.26 Exercise . Show that the name ordered (4-) tuple is apt for
x , y , z , w
by showing that
x , y , z , w
=
X, Y, Z, W
implies that x = X , y = Y , z = Z and w = W .
1.1.2.27 Exercise . Write down explicitly the set for which the tuple
x , y , z , w
is compact notation .
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
We will employ the symbols
as alternative shorthands for this product.
If A 1 = A and A 2 = B then we write A × B rather than
. 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
.
1.1.2.29 Example . {1} × {2} = {
1,2
} and {2} × {1} = {
2, 1
}. Thus {1} × {2} ≠ {2} × {1} ; the Cartesian product is not commutative in general.
can be given by a simple recursive (inductive) definition:
and, for n ≥ 1,
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
1.1.2.30 Example . A ×
=
, since
x , y
A ×
is equivalent to x
A ⋀ y
, which is false. Similarly,
× A =
.
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
( A ) or 2 A —is { x : x ⊆ A }.
1.1.2.32 Example . Thus, 2
= {
}; 2 {
} \= {
, {
}}; and 2 {
,{
}} \= {
, {
}, {
}}, {
, {
}}}.
2 {0,1} = {
,{0},{1},{0,1}}.
Since
⊆ A and A ⊆ A for any set A , we have always
2 A and A
2 A .
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
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
a , a , b , a , b , a
.
Concatenation of
a 1 ,…, a m
and
b 1 ,…, b n
in that order, denoted as
a 1 ,…, a m
*
b 1 ,…, b n
is the string of length m + n
a 1 ,…, a m , b 1 …, b n
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 “
” 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
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,
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.
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.
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
1, 1, 1
,
11, 1
, or
1, 11
?
1.1.3.2 Definition. (Languages) A language, L , over an alphabet A is just a subset of A *.
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
L ⋀ y
M }
.
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 .