logic as mathematics hartley rogers, jr. henry cohn

53
LOGIC AS MATHEMATICS Hartley Rogers, Jr. Henry Cohn © 2001 Hartley Rogers, Jr., Henry Cohn This material is for private circulation only and may not be further distributed.

Upload: khangminh22

Post on 09-May-2023

0 views

Category:

Documents


0 download

TRANSCRIPT

LOGIC AS MATHEMATICS

Hartley Rogers, Jr.

Henry Cohn

© 2001 Hartley Rogers, Jr., Henry Cohn

This material is for private circulation only and may not be further distributed.

1.

LOGIC AS MATHEMATICS

§1. THE LANGUAGE L .

We describe and study an artificial language which we callL .

The syntaxof L concerns definitions, rules, relationships, and theorems about

the symbols and formulas ofL , where these definitions, rules, relationships, and

theorems make no reference to possible meanings which we may intend to associate

with those symbols and formulas.

The semanticsof L concerns definitions and relationships which describe

how we can, in fact, attribute mathematical meaning to the symbols and formulas of

L . In particular, we shall define certain mathematical objects, called structures, to

which formulas ofL can refer, and we shall give a mathematical definition for a

relationship of truthbetween formulas and structures. We customarily assert that this

relationship holds between a given formula and a given structure by saying that the

given formula “is true” of the given structure, or by saying, equivalently, that the

given structure “satisfies” the given formula. Accordingly, we shall sometimes refer

to this relationship oftruth between formulas and structures as the relationship of

satisfactionbetween structures and formulas.

§2. THE SYNTAX OF L.

We specify a finite alphabet of basic symbols.

Basic Symbols: Names of Symbols

x y z thevariable symbols

′ theprime

| thevertical bar

2.

¬ thenegation symbol

∧ ∨ → ↔ theconnective symbols:

conjunction, disjunction,

conditional, andbiconditional

∀ ∃ theuniversal quantifier symbol

and theexistential quantifier

symbol

= theidentity symbol

P therelation symbol

[ ] the left bracketand theright

bracket

Strings:A string is an arbitrary finite sequence of basic symbols. Thelength

of a given string is defined to be the length of this sequence. For example, the length

of the string ∧x|∧[↔′′∀∃ is 10. Two strings are said to be equalif they have the

same length and the same occurrences of the same symbols in the same order. A

string S1 is said to occur as a substringof a string S2 if S1 is equal to a segment of

adjacent symbols in S2. (It follows that every string occurs as a substring of itself and

that two strings are equal if and only if each occurs as a substring of the other.) We

also include under our definition ofstring the sequence of basic symbols of length

zero. We call this string theempty string.

Variables: A string consisting of a variable symbol followed by a finite

number (possibly zero) of primes followed by a single vertical bar is called a

variable(for example: y′′′|.) In working withL , we shall sometimes use a numerical

subscript to abbreviate the primes/bar in a variable (for example, we might

abbreviate y′′′|

3.

as y3.) The purpose of thebar in a variable is to mark the termination of the sequence

of primes in that variable and thus to avoid the undesirable syntactical ambiguity of

having one variable appear as an initial substring of another (and different) variable.

Quantifiers:A string which consists of a quantifier symbol followed by a

variable is called aquantifier(for example:∀y′′′|.)

NQ-strings:A string which is either empty or composed entirely of one or

more negation symbols and/or quantifiers is called anNQ-string(examples:¬¬¬,

∀x|∃y|∀z|, and¬∀x|∃y|¬∃x|¬ .)

Admissible sets of strings.A setA of strings is said to beadmissibleif A

satisfies the following four closure rules:

(1) For every choice of variables u and v, the strings composed as

[u=v] or as [uPv] must be inA. Strings of this form are calledatomic formulas

(examples: [y|=z|] or [x′′|Px′′|] .)

(2) If a string S is inA, then the string composed as¬S must also be

in A

(3) If the strings S1 and S2 are inA, then each of the four strings

composed as [S1∧S2], [S1∨S2], [S1→S2], and [S1↔S2] must be inA.

(4) If u is a variable and S is a string inA, then the string composed as

∀uS must be inA, and the string composed as∃uS must be inA.

Note from rule (1) that an admissible collection of strings must be infinite.

Well-formed formulas: Let S be the set of all strings. Evidently,S is an

admissible set. LetWbe the intersection of all the admissible subsets ofS (we include

4.

S itself as a subset ofS.) It follows thatWmust also be admissible since, as is easily

shown,W must satisfy each of the four closure rules.W is called the set ofwell-

formed formulas(“wffs”) of L (for example,¬[∀x|∃y|[y|Px|]→¬[z′|=z′|]] is a wff.)

Henceforth, we shall customarily abbreviate expressions for wffs by omitting vertical

bars (the preceding example would be abbreviated as¬∀x∃y[yPx]→¬[z′=z′] .) The

underlying string of basic symbols of a wff is easily restored from such an

abbreviated version since the presence and position of the missing bars will be

evident from the abbreviated version of the given wff.

SinceW is admissible, we have the following:

If θ is a wff, then the string composed as¬θ is also a wff. This new

wff is called thenegationof θ.

If ϕ andψ are wffs, then each of the four strings composed as [ϕ∧ψ],

[ϕ∨ψ], [ϕ→ψ], and [ϕ↔ψ] is also a wff. These new strings are known, respectively,

as theconjunction, thedisjunction, theconditional, and thebiconditional, of ϕ

followed byψ.

If u is a variable andθ is a wff, then each of the two strings composed

as∀uθ and as∃uθ is a wff. The first of these new strings is called theuniversal

quantification ofθ with respect tou, and the second is called theexistential

quantification ofθ with respect tou.

Reading wffs. In working with the syntax ofL , it is convenient to use certain

words or phrases of ordinary language as names for the connective symbols, the

quantifier symbols, the negation symbol, and the identity symbol, when these

symbols appear in a wff. Commonly used words and phrases include:

for ¬, “not”, “it is not the case that”;

5.

for ∧, “and”;

for ∨, “or”;

for →, “only if”

([S1→S2] can also be read as “if S1 then S2”);

for ↔, “if and only if”;

for ∀u, “for every u”, “for all u”;

for ∃u, “there exists a u such that”;

for =, “equals” , “is identical with”.

These words and phrases also have intuitive value. As we shall later see, they

suggest, for sufficiently simple wffs, the semantical relationships which we will

eventually define for those wffs. For more complex wffs, these words and phrases

have diminished intuitive value. Precise mathematical treatment of the semantical

relationships of such complex wffs requires careful attention to the positions and

nesting of brackets and to the use of certain inductive definitions. Example: the

preceding example of a wff can be read as “it is not the case that -- for every x there

exists a y such that yPx - only if - z′ is not equal to z′”. (where pauses are indicated

by hyphens.)

First inductive principle for wffs. In order to show that a given set of stringsB

includes all the wffs, it is enough to show thatB is admissible.This principle is

immediate from the above definition of wff. We use this principle to prove Theorems

1, 3, and 5 below.

Bracket-occurrences. A particular occurrence of a bracket (either a left-

bracket or right-bracket) in a string S is called abracket-occurrencein S. (Exercise:

6.

use the first inductive principle to conclude that the number of occurrences of a

bracket in a wff must be positive and even.)

Bracket-count: Given a bracket-occurrenceω in a string S, we inductively

define bS(ω), thecumulative bracket-count for the occurrenceω in the stringS, as

follows:

If ω is the initial (from the left) bracket-occurrence in S, then

bS(ω) = 0.

If ω is not the initial bracket-occurrence in S, letω′ be the closest

preceding bracket-occurrence. Then

bS(ω) = bS(ω′) + 1, if ω andω′ are both left brackets;

bS(ω) = bS(ω′) – 1, if ω andω′ are both right brackets;

bS(ω) = bS(ω′), if ω andω′ are brackets of opposite kinds.

For example, the successive bracket-counts in the wff

¬[∀x∃y[yPx]→¬[z=z]]are 0,1,1,1,1,0, and the successive bracket-counts in the

string [ [ [ ] [ ] ] [ ] ] are 0,1,2,2,2,2,1,1,1,0. The bracket-count for a wffθ is

sometimes referred to as thedepth functionfor θ, since it measures the depth at

which each bracket-occurrence lies in the nesting of the bracket-occurrences in the

wff θ. The maximum value of the depth function for a wffθ is called thedepthof θ.

Theorem 1. Letθ be a wff. Then the following statements must be true:

(a) the final basic symbol ofθ must be a right bracket; the initial bracket-

occurrence ofθ must be a left bracket; and the bracket-count at each these two

bracket-occurrences must be 0.

7.

(b) the bracket-count at each of the other bracket occurrences inθ must be

greater than 0.

Proof.Let B be the collection of all strings which satisfy (a) and (b). It is easy

to show thatB is admissible. We consider conditions (1) – (4) in the definition of

admissible set.(1) holds, since every atomic formula has exactly two bracket-

occurrences, each with bracket-count = 0. (2) is immediate, since the bracket-count

for ¬S must be the same as for S. For (3), we note that if strings S1 and S2 each

satisfy (a) and (b), it is evident from the definition ofbracket-countthat the string

composed as [S1→S2] must also satisfy (a) and (b), since the value of the bracket-

count in [S1→S2] for any given bracket-occurrence in S1 must be greater by 1 than

the value of the bracket-count in S1 for that bracket-occurrence; and similarly for any

given bracket-occurrence in S2. The same argument applies to strings composed as

[S1∧S2], [S1∨S2], or [S1↔S2]. The argument for (4) is the same as for (2). Hence, by

the inductive principle, every wff must satisfy (a) and (b).

Subformulas. Let ϕ andθ be wffs. We say thatϕ occurs as a subformulaof θ

if ϕ occurs as a substring ofθ. (Note that there may be more than one occurrence of

ϕ as a subformula ofθ.)

Corollary 2. Consider given occurrences of a wffϕ and a wffψ as subformulas of a

wff θ. It must be the case that either: (i) the occurrence ofϕ is a substring of the

occurrence ofψ, or (ii) the occurrence ofψ is a substring of the occurrence ofϕ, or

(iii) the occurrences ofϕ andψ do not overlap (that is to say, there is no occurrence

of a basic symbol inθ which is common to the given occurrences ofϕ andψ.)

8.

Proof.This fact follows as a corollary to Theorem 1. It is enough to show that

if the occurrences forϕ andψ overlap inθ, then one of these occurrences must be a

substring of the other. Assume that the given occurrences ofϕ andψ overlap.

Case 1: The occurrences forϕ andψ share the same final bracket-occurrence.

Then, ifϕ andψ have the same length, then they must occur as the same substring of

θ, and hence each is a substring of the other. Ifϕ andψ do not have the same length,

then the occurrence of the shorter must be a substring of the occurrence of the longer.

Case 2: The final bracket-occurrences for the given occurrences ofϕ andψ in

θ are distinct. Letω1 be the final bracket-occurrence forϕ, and letω2 be the final

bracket-occurrence forψ. By Theorem 1, both must be right brackets. Without loss

of generality, we can assume thatω1 appears to the left ofω2 in θ. Since the

occurrences ofϕ andψ overlap, and since, by Theorem 1,ω1 is the final symbol inϕ,

ω1 must appear in the occurrence ofψ. Let ω1* be the initial bracket-occurrence inϕ,

and letω2* be the initial bracket-occurrence inψ. We consider three subcases:

(a) ω1* = ω2* . This is impossible because it implies that

bψ(ω1) = bϕ(ω1) = 0, contrary to Theorem 1 forψ.

(b) ω2* precedesω1* in θ. Thenω2* is not in ϕ, andϕ must be a substring of

ψ.

(c) ω1* precedesω2* in θ. Then the change in bracket-count fromω1* to ω1 in

θ must be 0 by Theorem 1 forϕ. This implies that the change fromω2* to ω1 must be

negative by Theorem 1 forϕ; but this implies that the change fromω2* to ω1 must be

negative inψ, since it is the same interval of count for bothϕ andψ. This contradicts

Theorem 1 forψ. Thus (b) is the only possible subcase, and Corollary 2 is proved.

Theorem 3. If a wffθ has more than two bracket-occurrences, then it has a unique

(one and only one) bracket-occurrenceω with the following three properties:ω is a

9.

right-bracket;bθ(ω) = 1; andω is immediately followed a connective. Furthermore,

the next bracket-occurrence afterω in θ must be a left-bracket.

Proof.Consider the setΣ of all wffs θ which satisfy Theorem 3. By Theorem

1, each of these wffs has a final right-bracket of depth 0. Furthermore,Σ must

contain all the atomic formulas and must be closed under negation and

quantification. It follows by the definition of bracket-count thatΣ is closed under

conjunction, since the new combined wff will have exactly two right brackets of

depth 1, the first of which must be directly followed by the conjunction symbol,

while the second must be directly followed by a final right bracket; similarly for

disjunction, conditional, and biconditional. ThusΣ is an admissible set, and

Theorem 3 follows by the inductive principle. If a wffθ has more than two bracket-

occurrences, then the unique connective-occurrence specified in Theorem 3 is

referred to as theprincipal connective ofθ.

Corollary 4. A given wffθ must be exactly one of the following: an atomic formula, a

quantification, a negation, a conjunction, a disjunction, a conditional, or a

biconditional.

Proof.Consider the initial symbol ofθ. If it is neither a negation symbol nor a

quantifier symbol and if the wff is not an atomic formula, then, by the inductive

principle, it must be a bracket and, by Theorem 3, there must be a unique principal

connective, say∧. Thusθ = [S1∧S2]. Moreover, S1 and S2 must both be wffs,

otherwise the collection of strings obtained by removingθ from W would be an

admissible set, contradicting our assumption thatθ is a wff. (A weaker version of

Corollary 4 can be obtained by putting “at least one” in place of “exactly one”. This

10.

weaker version is immediate by the inductive principle and does not require Theorem

3.)

Subformula-occurrences. By asubformula-occurrencein a given wffθ, we

mean a subformulaϕ coupled with a particular locationof ϕ in θ. (We can think of

this subformula-occurrence as the ordered pair (ϕ,i), where the occurrence begins at

the i th symbol ofθ.) We define Subocc(θ) to be the set of all subformula-occurrences

in θ. If a is a member of Subocc(θ), we define |a| to be the wff part ofa. Thus when

a andb are two different occurrences of the same wffϕ as a subformula ofθ, we

will have thata ≠ b but |a| = |b| = ϕ. Let a andb be members of Subocc(θ). We say

thata is contained inb if a occurs as a substring of the occurrenceb, and we say

thata is properly contained inb if a is contained inb anda ≠ b. (That is to say, ifa

is contained inb and |a| is shorter than |b|.) As an abbreviation for “a is properly

contained inb”, we write: a π b. We say thata is animmediate predecessorof b if

a π b and if for noc in Subocc(θ) is true thata π c π b. Finally, we say thatb

is animmediate successorof a if a is an immediate predecessor ofb.

Theorem 5. For any given wffθ, the relationπ has the following properties:

(i) It is never true thata π a.

(ii) If a π b andb π c , thena π c .

(iii) There exists a uniqueb in Subocc(θ) such that for alla ≠ b,

a π b, and for thisb, |b| = θ.

(iv) If |a| ≠ θ, a has exactly one immediate successor.

(v) Everya has either 0, 1, or 2 immediate predecessors.

(vi) If a has no immediate predecessor, then|a| must be an atomic

wff; if a has exactly 1 immediate predecessor, then|a| must be

11.

either a negation or a quantification; and ifa has 2

immediate predecessors, then|a| must be either a conjunction,

a disjunction, a conditional, or a biconditional.

(vii) Subocc(θ) is a finite set.

Proof. (i) and (ii) are immediate from the definitions. ((i) and (ii) assert that

the relationπ is astrict partial ordering.) For (iii), let b = (θ,1) be the unique

occurrence ofθ as a subformula of itself. ((iii) asserts that the partial orderingπ has

a maximum element.) (iv) follows from Corollary 2. (v) and (vi) follow from

Corollary 4. For (vii), let n = the length ofθ. For a pair (ϕ,i) there can be no more

than n possible values for i, and for each of these values, there can be no more than n

different substringsϕ. Hence there can be no more than n2 subformula-occurrences in

Subocc(θ).

Subformula trees. In Theorem 5, (iii) and (iv) assert that that the partial

ordering is atree,and (v) asserts that this tree is abifurcating tree(that is to say, no

element can have more than two immediate predecessors.) We refer to this tree as the

subformula treefor the given wffθ. The various subformula-occurrences are referred

to asnodesof the tree.

For a given wffθ, let a0 be a node with no predecessors. (This node must be

an occurrence of an atomic formula inθ.) Since the entire tree is finite, there exists a

unique finite sequencea0, a1, …, ak such that for all i, 0 <i < k–1,ai+1 is the

immediate successor ofai and |ak| = θ. This sequence is called thebranchof the tree

determined byb0, andao is called theterminal elementof this branch. If we take the

terminal elements in the same left-to-right order in which they appear inθ, we can

12.

obtain a uniquetree-diagramfor the subformula tree. For example, forθ = the wff

¬[∀x∀y[yPx]→¬[z=z]], we have the tree-diagram:

¬[∀x∀y[yPx]→¬[z=z]]

ÿ

∀x∀y[yPx]→¬[z=z]]

/ \

∀x∀y[yPx] ¬[z=z]

ÿ ÿ

∀y[yPx] [z=z]

ÿ

[yPx]

In this example, there are two branches; the left branch has 5 nodes, and the right

branch has 4.

The rank of a wff. We define therank of a wff to be the maximum length of a

branch in its subformula tree, where we take the distance from a subformula-

occurrence to its immediate successor to be 1 (thus an atomic formula has rank 0.)

We now have three measures of complexity for a wff:length, rank,anddepth. In the

above example, the given wff has length = 25 (including bars), rank = 4, and depth =

1. It is easy to show that for any wff, we must always have:depth <rank < length.

Corollary 6. Every wff has a finite rank.

Proof. From Theorem 5 (vii).

13.

As a further corollary to Theorem 5, we have:

Second inductive principle for wffs. Let P be an alleged property of wffs. LetP(r) be

the assertion that all wffs of rank <r have the property. If we can show (i) thatP(0),

and (ii) that for all r > 0, P(r) impliesP(r + 1), then we can conclude that all wffs

have the property.

Defining a function onWby tree-induction. Let f be a function from the setW

of all wffs into some specified collectionQof mathematical objects. (Qmight be the

setN of non-negative integers, or it might be a set of algebraic objects of a more

complex kind.) We say f istree-inductiveif there exist eightdefining functionsh0,

h¬, h∧, h∨, h→, h↔, h∃, and h∀ with the following properties:

(1) h0: W0 → Q, where W0 is the set of atomic wffs, and h0 has the property

that for any wffϕ in W0, f(ϕ) = h0(ϕ). Thus h0 can be seen as prescribing the

behavior of f onW0.

(2) h¬: Q → Q, with the property that f(¬ϕ) = h¬(f(ϕ)). Thus h¬ prescribes

the value of f for¬ϕ, given the value of f forϕ.

(3) h∧: Q × Q → Q, with the property that f([ϕ∧ψ]) = h∧(f(ϕ), f(ψ)). Here

h∧

prescribes the value of f for [ϕ∧ψ], given the values of f forϕ andψ.

(4) – (6) Similarly to (3) for h∨, h→, and h↔.

(7) Let V be the set of all variables in L. Then h∃: V × Q → Q. Here f(∃uϕ)

= h∃(u, f(ϕ)), and we see that h∃ prescribes the value of f for∃uϕ, given the variable u

and the value of f forϕ.

(8) Similarly, we have h∀: V × Q → Q, and f(∀uϕ) = h∀(u, f(ϕ)).

14.

Examples. (a) LetQ= N, the set of non-negative integers. Let f(θ) = the rank

of θ. f is tree-inductive, since it is prescribed by the eight defining functions: h0(ϕ) =

0; h¬(n) = n + 1; h∧(m, n) = h∨(m, n) = h→(m, n) = h↔(m, n) = max{m, n} + 1; and

h∃(u, n) = h∀(u, n) = n + 1.

(b) Let Q = N. Let f(θ) = the depth ofθ. f is tree-inductive; the

defining functions are the same as for example (a), except that h¬(n) = h∃(u, n) =

h∀(u, n) = n.

(c) Let Q = N. Let f(θ) = the length ofθ. For any variable u, let

ln(u) = the length of the string u. f is tree-inductive, since it is prescribed by the

following eight defining functions: h0([uPv]) = h0([u=v]) = ln(u) + ln(v) + 3; h¬(n) =

n + 1; h∧(m, n) = h∨(m, n) = h→(m, n) = h↔(m, n) = m + n + 3; h∃(u, n) = h∀(u, n) =

ln(u) + n + 1.

Theorem 7. For any eight defining functions of the forms described above, and for

any wffθ: (i) there is a uniquefunctionfθ from the nodes of the subformula tree ofθ

to Qsatisfying the inductive conditions prescribed by those defining functions; (ii)

for any other occurrence ofθ as a node in the subformula tree of some other wffψ,

we havefψ(θ) = fθ(θ); and (iii) if we definef(θ) = fθ(θ), we see that this functionf

from W to Q is uniquelydefined by these eight defining functions.

Proof. If (i) fails, consider a node of lowest rank at which there is either no

value of fθ or more than one value for fθ; the contradiction is immediate. For (ii) and

(iii), we see that if we have two different subformula occurrences ofθ in two

possibly different subformula trees, then the subtrees determined by these two

occurrences ofθ must be identical.

15.

We can summarize the result of Theorem 7 as:

Principle of tree-induction for wffs. Given a setQand any eight defining functions

as described for Theorem 7, there exists a unique functionf from W(the set of all

wffs) into Q such that for any wffθ, f satisfies the prescribed conditions as they

apply toθ.

As an application of Theorem 7, we have:

Exchange principle for tree-induction: Let f be a function defined onW by tree-

induction; letθ be a wff; letϕ occur as a subformula ofθ; let ψ be any wff such that

f(ψ) = f(ϕ); and letθ′ be a wff which results when the stringψ is substituted for the

string ϕ at one or more occurrences ofϕ in θ. Thenf(θ′) = f(θ). [In other words, if

we replace any subformula by another wff with the same f-value, the the f-value of

the entire wff must remain unchanged.]

Proof.The tree ofθ′ results from replacing the subtree forϕ by the tree ofψ

at one or more nodes in the tree ofθ. Since f(ψ) = f(ϕ), the inductive steps at all

unreplaced nodes in the tree ofθ remain unaffected by the replacement..

16.

§3. ALGORITHMS AND DECISION PROCEDURES

A symbolic functionf is a function (or “mapping”) whose inputsare certain

finite strings of symbols from some finite set Ai of symbols (theinput alphabet for f)

and whose outputsare finite strings of symbols from some (possibly different) finite

set Ao of symbols (theoutput alphabetfor f.) We shall use the following notations in

connection with a symbolic function f.Si will be the set of all finite strings of

symbols from Ai; D will be an infinite subset ofSi consisting of those members ofSi

which will

serve as possible inputs to f; andSo will be the set of allfinite strings of symbols

from Ao. D is called thedomain of f. Thus asymbolic functionf from D into So is a

subset ofD × So; such that for every member s ofD, there is a unique member t ofSo

such that (s,t) is a member of f. We can then express the assertion that (s,t) is a

member of f by writing: f (s) = t.

Examples. (1) Let f be the symbolic function which has, as its domain, the set

S of all finite strings of basic symbols ofL , and which gives, as corresponding

output for each input string S, the binary expression for the length of S. Here,Si = S

= D; Ao consists of the two symbols ‘0’ and ‘1’; andSo is the set of all finite strings

from Ao.

(2) Let g be the function which has, as its domain, the set of all wffs

of L of depth > 0, and which gives, as corresponding output for each input wff, the

symbol for the principle connective of that wff. Here Ao = { ∧,∨,→,↔}.

(3) Let h be the function which has, as its domain, the setS of all

finite strings of basic symbols ofL , and which gives, as corresponding output for

each input S, the symbol ‘1’ when S is a wff and the symbol ‘0’ when S is not a wff.

17.

Let D be the domain for a given symbolic function f, and letC be a subset of

D. If a symbolic function f gives output ‘1’ for each input fromC, and output ‘0’ for

each input which is inD but not fromC, we say that f is thedecision functionfor C

on D. In example 3 above, h is the decision function forW on S.

Algorithms. [The following introduction to algorithms is informal; a more

formal treatment will appear in a later in this text.] By an “algorithm” for a symbolic

function f, mathematicians have traditionally meant a finite set of instructionsby

means of which one can carry out, for any input s for f, a well-defined and

deterministic hand-computation producing f(s). We now sharpen this to a narrower

and more specific definition: Analgorithmfor a symbolic function f is a finite,

dedicated, digital computerwhich accepts any input s for f and eventually produces

the corresponding output f(s). (Evidently, a general-purpose computer, together with

an appropriate fixedprogram, can also be viewed as an algorithm for f.) We also

make these assumptions: (1) Given a specific input s, the computation determined by

the algorithm is carried out in a sequence ofcomputation-steps, where the nature of

each step is determined by the current internal state of the computer and its memory.

(2) The content and duration of a computation-step can be defined as the actions

which occur during a single cycle of the computer’s timing clock. (3) For each input

s, the computer produces the output f(s) after a finite number of computation-steps,

where the number of steps depends on the particular input. (4) An input s is given to

the computer as a finite sequence of input symbols on a tape. Thisinput tapeis read

at the rate of one-symbol-per-step as the computation proceeds. The output f(s) is

printed on anoutput tapeat the rate of one-symbol-per-step as the computation

terminates. (5) Additional memory (blank and erasable) is provided to the computer,

in finite increments, as needed during a computation.

18.

Note that a given symbolic function may have more than one algorithm, and that one

algorithm for a given symbolic function may be significantly more efficient (take

fewer steps) than another algorithm for that function.

Decision procedures. For a given domainD and subsetC, an algorithm for

the decision function forC on D is called adecision procedure forC on D.

Computability. Let f be a given symbolic function. If there is an algorithm for

f, we say that f iscomputable. If the decision function forC on D is computable,

we say, equivalently, that thedecision problem forC on D is solvable.

Examples. In example 1 above, in order to compute f for a given input string

in S, we need only count the number of symbols in that string and give the result in

binary notation. It is easy to write a single finite program (for a general purpose

computer) which will do this for all strings inS. Hence, by definition, f is

computable. In example 2 above, in order to compute g(ϕ) for a given wff ϕ of depth

> 0, our algorithm need only calculate the bracket count forϕ and find the symbol in

ϕ that immediately follows the first right-bracket of depth 1. We give this symbol as

output. Thus g is computable. We now turn to example 3. In Theorem 8 below, we

show that the decision problem forW on S is solvable.

Theorem 8. There exists an algorithm such that for any string S inL as input, this

algorithm produces output‘1’ when S is a wff, and produces output ‘0’ when S is not

a wff.

Proof.Let S be a given string. Let n be the length of S. We give an informal

outline of the algorithm:

Part 1. Make a list of all substrings of S which happen to be atomic

19.

formulas; call these wffsα1, α2, …, αk. Make a list of all substrings of S which

happen to be variables; call these variables u1, u2, …, up. Each of these two lists must

be finite.

Part 2.The computation now proceeds in stages(where each stage can be

accomplished in a finite number of computation-steps.

Stage 0.See if S occurs in the listα1, …, αk. If so, we have found

that S is a wff of rank 0; we end the computation and give output ‘1’. If not, we have

found that S cannot be a wff of rank 0, and we go on to stage 1.

Stage 1.Make a list of all wffs of rank <1 which can be constructed

from α1, α2,. …, αk with repetitions permitted and with new quantifier variables (if

any) restricted to u1, …, up. There can only be finitely many wffs on this new list. See

if S occurs in this list. If so, we have found that S is a wff of rank 1; we end the

computation and give output ‘1’. If not, we have found that S cannot be a wff of rank

< 1, we go on to stage 2.

……………..………………………………………………………………………..

Stage m+1, for m <n – 2 . Make a list of all wffs of rank <m + 1

which can be constructed from the list of wffs of rank <m made in stage m, with

repetitions permitted and any new quantifier variables restricted to the uj, …, up.

There can be only finitely many wffs on this new list. See if S occurs in this list. If

so, we have found that S is a wff of rank m + 1; we end the computation and give

output ‘1’. If not, we have found that S cannot be a wff of rank <m + 1; we go on to

stage m + 2. If necessary, proceed in this way through stage m = n – 1.

Finally, we have:

Stage n.End computation; give output ‘0’.

20.

To complete our proof of Theorem 8, we note, from the definitions of

subformula-treeandrank, that for any m, a wff of length m must have rank < m.

Since S has length n, it follows that if S is a wff , then S must have been constructed

by stage n – 1, and our algorithm must have given output ‘1’. If we do not find that S

is a wff by stage n – 1, we know that S is not a wff, and we give output ‘0’ at stage n.

Computational complexity. As we shall see, the decision procedure described

in Theorem 8 can require a large amount of computation time (as measured by

number of computation-steps) for an input string of only moderate size. An algorithm

of this kind is said to have a high level ofcomputational complexity. We make the

following definitions. Let f be a given symbolic function fromD into So. Assume

that we have a particular algorithm for f. Let s be any given finite string inD. We

define ||s|| to be the length of s, and we define #(s) to be the number of computation-

steps used by our algorithm to compute f (s). For any given n > 0, we then define

T (n) = )s(#maxn||s|| ≤

.

The function T(n) is positive and non-decreasing. It is called thetime-complexity

functionfor the given algorithm. It is customary to compare time-complexity

functions by comparing their respective asymptotic rates of growth. An algorithm

with complexity function T(n) is said to haveat-most-polynomial growthif there is a

positive integer k such that .)n(T

nlim

k

n∞=

∞→. We abbreviate this last limit by

writing ∞→)n(T

nk

(we use analogous abbreviations in other cases below.) An

21.

algorithm with complexity function T(n) is said to haveat-most-exponential growth

if there is a real number a > 1, such that ∞→)n(T

an

It is said to haveat-least-

exponential growthif there is a real number a > 1 such that ∞→na

)n(T. An algorithm

with complexity function T(n) is said to havesuperexponential growthif for every

real number a > 1, ∞→na

)n(T. It is easily shown, from these definitions, that an

algorithm which has at-most-polynomial growth cannot have at-least-exponential

growth and that an algorithm which has at-most-exponential growth cannot have

superexponential growth.

An algorithm which has at-most-polynomial growth is conventionally viewed

as “fast”. An algorithm which has at-least-exponential growth is conventionally

viewed as “slow”. An algorithm which has superexponential growth is sometimes

viewed as “impracticably slow”.

Theorem 9. The algorithm given in the proof of Theorem 8 has superexponential

growth.

Proof.Let T(n) be the time complexity function for the algorithm given in the

proof of Theorem 8. We prove the following lemma, from which Theorem 9 will

directly follow.

Lemma. Forn > 15, T(n) >1n22

.

Proof of lemma.Consider the string s = [x|Py|]∨[x|=y|]. Note that s is not a

wff (it fails Theorem 1) and that the length of s is 15. Applying the algorithm to s,

we

22.

find that the computation must continue through stage 14. Note that the list for stage

0 has 2 atomic wffs and that 2 =022 . If we consider only connections which use the

single connective∨, and if we disregard all uses of quantification, we see that the list

at stage 1 must contain at least22 =122 wffs, and that the list at stage 2 must contain

at least(22)2 =222 wffs. By the same argument, at stage 14 we must have at least

1422 wffs in the new list. Since listing and comparing each of the wffs in this list with

the original input string must require at least one computation-step, we have T(15) >1422 . Similarly, for any input s with n >15, we have T(n) >

1n22−

. This proves the

lemma.

To complete the proof of Theorem 9, we need only show that for every real a > 1,

∞→− n2 a2

1n

. This is easily proved by use of L’Hopital’s rule together with the fact

that ∞→∞→ )n(flogifonlyandif)n(f . (L’Hopital’s rule asserts that if f and g are

differentiable, increasing, positive-valued functions on the positive real numbers,

then ∞=�∞=∞→∞→ g

flim

'g

'flim

xx.)

Note that T(15) >1422 is already a very large number. If we perform one

computation-step per nanosecond and blindly apply the prescribed algorithm to the

input [x|Py|]∨[x|=y|], the computation will require at least 104910 centuries. Note also

that, however absurd this algorithm may seem, it has served a useful purpose for us:

it has provided a proof that the decision problem forW on S is, in fact, solvable.

23.

We now turn to the task of finding a faster algorithm for the decision function

for W on S. The following theorem will be useful for this purpose.

Theorem 10. Letθ be a wff. For m >0, let km be the number of bracket-occurrences

of depth m inθ. Then k0 = 2, and for each m > 0, we have: (a) km = 4q, for some q

> 0; and (b) the bracket-occurrences of depth m determine q non-overlapping

substrings ofθ such that each substring begins with a bracket-occurrence of depth

m, ends with a bracket-occurrence of depth m, and includes two other bracket-

occurrences of depth m. Furthermore, (c) in each such substring, the first bracket-

occurrence of depth m is a left-bracket, the second bracket-occurrence of depth m is

a right-bracket, the third bracket-occurrence of depth m is a left-bracket, and the

fourth and last bracket-occurrence of depth m is a right-bracket. Furthermore, (d)

within in each of these substrings, all bracket-occurrences of depth≠ m have depth

greater than m, while (e) between any two such substrings, there is at least one

bracket-occurrence of depth less than m.

Proof. It will be enough to show that the set of all strings satisfying the

properties asserted forθ in Theorem 10 is admissible. Evidently, every atomic

formula satisfies these properties, and the negation or quantification of a string

having these properties must have these properties. It remains to show, for example,

that the conjunction of any two strings having these properties must also have these

properties. This is immediate when we note that the depths of all bracket-occurrences

in the two component strings (of the conjunction) are increased by 1 when the

conjunction is formed, that the new conjunction must have exactly four brackets of

depth 1, and that (for (e)) any two four-bracket segments of depth m > 1 must either

24.

lie in the same component string and already satisfy (e) or else lie each in a separate

component string and be separated by a bracket-occurrence of depth = 1.

Corollary 11. For the quantity km in Theorem 10, we have the bound: km < 2m+1.

Proof.This is immediate from the inductive construction in the proof of

Theorem 10.

We now use Theorem 10 to get an improved algorithm for the decision

function forW on S.

Theorem 12. There exists an algorithm of at-most-polynomial growth for the

decision function forW on S.

Proof.We first describe an algorithm and observe that it is a decision

procedure for a certain setC in S. We then show thatC = W. Finally, we show that

the algorithm has at-most-polynomial growth.

Let S be a given string of basic symbols ofL .

Part 1 of the algorithm.The computer makes a single pass through S

from the left. For S to be a wff, each of the following must hold: (a) There must be at

least one bracket-occurrence in S; the first bracket-occurrence in S must be a left-

bracket; and the string of symbols which precedes this first bracket-occurrence must

be a possibly empty NQ-string. (b) During this pass, the computer also considers

each substring of S whose first and last symbols are brackets and which contains no

other bracket-occurrence. There are four cases: (i) left-bracket then left-bracket– in

this case, the substring between must be a possibly empty NQ-string; (ii) left-bracket

then right-bracket– in this case, the substring between and including these brackets

must be an atomic wff; (iii) right-bracket then left-bracket– in this case, the

25.

substring between must be a single connective followed by a possibly empty NQ-

string; (iv) right-bracket then right-bracket– in this case, the substring between must

be empty. The last bracket-occurrence in S must be a right-bracket and must be the

last symbol in S. During this first pass through S, the computer also keeps a running

bracket-count, verifies that the conditions in Theorem 1 hold, and notes the highest

value of the bracket-count that occurs.

If S fails to meet any of the requirements in part 1, the calculation terminates

with output ‘0’. If the pass succeeds, the computer goes on to part 2.

Part 2.Let d be the maximum value of the bracket-count in part 1.

For each m, 1 <m < d, the computer makes a further pass through S to verify that

conditions b, c, d, and e in Theorem 10 are satisfied for the bracket-occurrences in S

of depth m.. If any of these passes fails, the computation ends with output ‘0’. If

each pass succeeds, the computation ends with output ‘1’.

If a string S of basic symbols ofL gives output ‘1’, we say that S is

acceptable. Hence, by definition, the algorithm provides a decision procedure for the

set of acceptable strings in S. In order to prove that the algorithm is a decision

procedure forW, it remains to prove two propositions:

Lemma13. Every wff is an acceptable string.

Lemma14. Every acceptable string is a wff.

Proof of Lemma 13.By a proof identical to the proof of Theorem 10,

except that “acceptable strings” replaces “strings satisfying the properties asserted for

θ in Theorem 10”, we find that the set of acceptable strings is admissible. Hence, by

the first inductive principle, every wff is an acceptable string.

Proof of Lemma14.Let S be an acceptable string. We prove Lemma

14 by mathematical induction on the depth of S, where thedepthof an arbitrary

string S is defined to be the maximum value of the bracket-count of S.

26.

Let P(m) be the assertion that for everyl , 0 < l < m , every acceptable string

of depthl is a wff..

Basis step. We showP(0). If S is acceptable and has depth 0, part 1

of the algorithm assures that S is an atomic formula preceded by a possibly empty

NQ-string. Hence S is a wff.

Inductive step. Assume thatP(m) is true We proveP(m+1). Let S be

acceptable and have depth m + 1. By part 2 of the decision procedure, there must be

exactly four bracket-occurrences of depth 1, and by part 1, the second occurrence

must be followed by an adjacent connective. Let S1 be the substring of S contained.

between and including the first and second occurrences of depth 1, and let S2 be the

substring of S contained between and including the third and fourth occurrences of

depth 1. By part 2 of the decision procedure, S1 and S2 must each have depth <m.

Hence, by our assumption thatP(m) holds, each of S1 and S2 must be a wff.. Hence,

by part 1, S must be consist of a possibly empty NQ-string followed by the

conjunction, disjunction, conditional, or biconditional of the wffs S1 and S2. Hence S

is a wff.

It remains to show that the algorithm described above has at most polynomial

growth. We accomplish this by considering our computation procedure in more

detail.

Let n be the length of the input string S. We first show that the first pass, described

in part 1 of the procedure, can be accomplished in exactly n steps. In order to achieve

this, the computer must be able to carry out several simultaneous tasks as it moves

through S: (i) It must verify that the symbols, which precede the first bracket form a

possibly empty NQ-string. (ii) It must verify that the symbols which lie between a

left- bracket and a succeeding left-bracket form a possibly empty NQ-string. (iii) It

must verify that the symbols which lie between a right-bracket and a succeeding left-

bracket form a connective followed by a possibly empty NQ-string. (iv) It must

verify

27.

that the that the symbols which lie between a left-bracket and a succeeding right-

bracket form the interior portion of an atomic wff. (v) It must maintain a running

bracket-count to signal when the bracket-count returns to 0. (vi) It must maintain a

record of the highest bracket count so far. (vii) It must check that the first bracket

exists and is a left-bracket, and that the final symbol is a right-bracket.

The computer does all this by using several registers whose operations (to test

for an NQ-string, for example) can be repeated during the first pass. This NQ-string

register, for example, contains at most one symbol at any time and shows ‘E’ (for

empty string) at the beginning of a test. If it shows E, it accepts only from the set N1

= { ¬, ∀, ∃} and shows that symbol; if it contains¬, it accepts and shows only from

N1; if it contains∀ or ∃, it accepts and shows only from N2 = {x,y,z}; if it contains x,

y, or z, it accepts and shows only from N3 = { ′, |}; if it shows ′, it accepts and shows

only from N3, if it contains |, it accepts and shows only from N1; if presented with an

unacceptable symbol, it shows the symbol F and ceases to operate. If it shows | or¬

or E when a bracket appears, this indicates that it has currently found a possibly

empty NQ-string. If it shows any other symbol, this indicates that an NQ-string has

not been completed. Similar single-symbol registers can be used to test for an atomic

wff, and to show whether the current bracket count is positive. At the beginning of

each computation step, the content of the single-symbol registers is fed to the

computer’s central processing unit and helps determine the actions to be taken during

that step. We observe that part 1 requires at most n computation steps.

If the string S is not rejected during this first pass, the computer goes on to

part 2. The maximum value d of the bracket-count has been preserved in memory

and, in accord with part 2, the computer proceeds to carry out d passes through S, one

for each value of m between 0 and d. Several more single-symbol registers can be

used

28.

for these tests, as in part 1. The number of registers required is easily shown to be

independent of n, d, and m. The value of m starts at 0 and increases by 1 with each

pass; the final pass occurs when m = d. We note that each pass in part 2 can be

carried out from left to right or from right to left, since the conditions in Theorem 10

are symmetrical with regard to direction through S. Hence the successive passes can

alternate in direction. It follows that part 2 requires at most n×d computation-steps.

Since d <n, we have the upper-bound: T(n) <n2 + n. Applying the definition

of at-most- polynomial growthwith exponent k = 3, we have

∞→+

=+

n

11

n

nn

n

)n(T

n2

33

. This completes the proof of Theorem 12.

(It is not hard to show that d <(1/9)n. Hence the above bound can be improved to

T(n) < (n2/9) + n.)

Invariance of complexity categories. It is a significant feature of the

complexity categories defined above (at-most-polynomial, at-least-exponential, at-

most-exponential,andsuperexponential) that relatively major changes in a given

complexity function are required to move that function out of the categoryat-least-

exponentialand into the categoryat-most-polynomial, or out of the category

superexponentialand into the categoryat-most-exponential.This implies that

relatively major changes in the fundamental nature of an algorithm will be required

to move that algorithm from one category to another. The following definitions and

theorem make this clear.

Let T(n) be a given complexity function, and let f(n) be a non-decreasing,

positive-valued function. The function T′(n) = T(n)× f(n) is called aslow-downof

T(n) by f(n). (It is the complexity that would result from taking an algorithm with

complexity T(n) and replacing each individual computation-step, for each input of

29.

length n, by a procedure which requires f(n) steps.) Similarly, the function T′′(n) =

T(n)/ f(n) is called aspeed-upof T(n) by f(n). (It is the complexity that would result

from taking an algorithm with complexity T(n) and, for each input of length n,

replacing every successive block of f(n) computation-steps by a single step.) If f(n)

has at-most-polynomial growth, we say that T′(n) is apolynomial slow-downof T(n)

and that T′′(n) is apolynomial speed-up ofT(n). Similarly forexponential slow-down

andexponential speed-up.

The following theorem is easily proved from these definitions.

Theorem 15. (a) If T(n) has at-most-polynomial growth, then a polynomial slow-

down of T(n) must still have at-most-polynomial growth.

(b) If T(n) has at-least-exponential growth, then a polynomial speed-

up of T(n) must still have at-least-exponential growth.

(c) If T(n) has superexponential growth, then an exponential speed-up

of T(n) must still have superexponential growth.

The complexity categories considered here are far from exhaustive. For example,

there exist algorithms with complexity functions that lie above all the at-most-

polynomial functions and below all the at-least-exponential functions, where “f

above g” or “g below f” means that f/g→ ∞ .

30.

§4. THE SEMANTICS OF L.

Occurrences of variables. The following syntacticalterminology will be used

in connection with the semanticsof the languageL . An occurrence of a variable v in

a wff θ is said to be a boundoccurrence if it occurs in a subformula (ofθ) of the form

∀vϕ or of the form∃vϕ. An occurrence of v inθ which is not a bound occurrence is

said to be a freeoccurrence inθ. Evidently, it is possible for a variable v to have both

free and bound occurrences in the same wff. If all occurrences of all variables in a

wff θ are bound,θ is said to be a closedwff. Closed wffs are also called sentences.

For example, [∀x∃y[xPy]→[xPx]] is not closed, since x has a free occurrence (in

fact, there are two free occurrences and two bound occurrences of x), while

[∀x∃y[xPy]→∃x[xPx]] is a sentence (with five bound occurrences of x and two

bound occurrences of y.)

Structures forL : Let D be an arbitrary, non-empty set. Let R⊆ D × D, where

D × D is the set of all ordered pairs (a,b) such that a∈ D and b∈ D. Then the

ordered pair (D, R) is called a structurefor L .

Examples:

(1) Let D be the setR of real numbers. Let R = {(s,t)

| (s,t)∈ R × R and s < t}. We refer to R as <R. Then (R, <R) is a structure forL , the

strict linear ordering of the real numbers.

(2) Let D be the setQ of rational numbers. Let R =

{(p,q) | (p,q)∈ Q × Q and p < q} = <Q. Then (Q, <Q) is a structure forL , thestrict

linear ordering of the rational numbers.

(3) Let D be the setZ of integers. Let R =

31.

{(m,n) | (m,n)∈ Z × Z and m < n} = <Z. Then (Z, <Z) is a structure forL , thestrict

linear ordering of the integers.

(4) Let D be the setZ. Let R = {(m,n) | (m,n)∈ Z × Z and

m divides n}=÷Z . (Here, “m divides n” means that n = mq for some integer q.) Then

(Z, ÷Z) is a structure forL , thepartial ordering of the integers under divisibility.

Satisfaction forL : Let α = (D,R) be a structure forL , and letσ be a

sentence (closed wff) forL . We wish to give a mathematical definition for the

concept that “σ is true ofα“ when we think of the variables ofL as ranging over D

and think of the relation symbol P as R. We will use the terminology: “α satisfiesσ“

for our desired concept, and we will write it:α |= σ. In order to obtain a

mathematical definition of “α |= σ” which accords with our intuition, we make a

wider definition which applies to wffs with free as well as bound occurrences of

variables. Recall thatV is the infinite set consisting of all the variables ofL . Let s be

a function (“mapping”) from the infinite setV to the set D. (Thus s takes variables of

L as inputs and gives members of D as outputs.) Such a function s is called an

assignmentfor the structureα, since s assigns to each variable a member of D. (We

allow a single member of D to be assigned to more than one variable, but each

variable must have a unique member of D assigned to it.) LetAα be the set of all

assignments forα, and letAα* be the set of all subsets ofAα. We use tree-induction to

define a function Sα: W → Aα* , where, for any wffθ, Sα(θ) is a member ofAα

*.

Sα(θ) will be calledthe set of assignments forα which satisfyθ. In the definition of

the function Sα which follows, note that the requirements for tree-induction, in terms

of the eight special functions of Theorem 7, are satisfied. The tree-induction goes as

follows:

32.

(1a)ϕ = [u=v]. Then Sα(ϕ) = {s ∈ Aα | s(u) = s(v)}.

(1b) ϕ = [uPv]. Then Sα(ϕ) = {s ∈ Aα | (s(u),s(v))∈ R}.

(2) Sα(¬ϕ) = {s ∈ Aα | s ∉ Sα(ϕ)}.

(3) Sα([ϕ∧ψ]) = Sα(ϕ) ∩ Sα(ψ).

(4) Sα([ϕ∨ψ]) = Sα(ϕ) ∪ Sα(ψ).

(5) Sα([ϕ→ψ]) = Sα(ψ)∪{s ∈ Aα | s ∉ Sα(ϕ)}.

(6) Sα([ϕ↔ψ]) = (Sα(ϕ)∩ Sα(ψ))∪({s∈Aα| s∉Sα(ϕ)} ∩{s∈Aα | s∉Sα(ψ)}).

Let v be a variable ofL , let c∈ D, and let s∈ Aα. We define the assignment svc ∈ Aα

by: (i) s vc (u) = s(u) for variables u different from v; and (ii) sv

c (v) = c.

(7) Sα(∃uϕ) = {s∈Aα | for some c∈D, scv ∈ Sα(ϕ)}.

(8) Sα(∀uϕ) = {s∈Aα | for every c∈D, scv ∈ Sα(ϕ)}.

For every wffθ of L , for any given structureα, and for any assignment s∈

Aα, we now writeα |= θ [s] if s ∈ Sα(θ), and we say thatα satisfiesθ under the

assignments.

The above definition ofsatisfactionby tree-induction is a central concept of

mathematical logic, and is due to Alfred Tarski. To help establish the reader’s

intuitive understanding of this concept, we repeat the definition ofsatisfactionfor L

in a different but equivalent form:

(1a) α |= [u=v] [s] if and only if (‘iff’) s(u) = s(v);

(1b) α |= [uPv] [s] iff (s(u),s(v))∈ R;

(2) α |= ¬ϕ [s] iff α |≠ ϕ [s];

(3) α |= [ϕ∧ψ] [s] iff α |= ϕ [s] andα |= ψ [s];

(4) α |= [ϕ∨ψ] [s] iff either α |= ϕ [s] or α |= ψ [s] (or both)

(5) α |= [ϕ→ψ] [s] iff either α |≠ ϕ [s] or α |= ψ [s] (or both);

33.

(6) α |= [ϕ↔ψ] [s] iff either: α |= ϕ [s] andα |= ψ [s] or else:

α |≠ ϕ [s] andα |≠ ψ [s].

(7) α |= ∃vϕ [s] iff for somec in D, α |= ϕ [svc ];

(8) α |= ∀vϕ [s] iff for every c in D, α |= ϕ [svc ].

This latter definition has the form of an induction by rank. In (7), for example, if∃vϕ

has rank r + 1, thenϕ has rank r, and we are inductively assuming thatα |= ϕ[s] has

already been defined for each s∈ Aα.

Facts about satisfaction:

Theorem 16. If assignmentss ands′ agree on the variables which occur free inθ,

then: α |= θ [s] iff α |= θ [s′].

Proof. Induction by rank: Ifθ has rank 0 (an atomic wff), the statement is

immediate by definition (cases (1a) and (1b)). In case (2), we note that the set of

variables occurring free does not change. In cases (3) – (6), we note that if s and s′

agree on the variables occurring free in [ϕ∨ψ] (for example) then s and s′ must agree

on the variables free inϕ andon the variables free inψ. In case (7), we assume that

the statement of the theorem holds for the wffϕ for all pairs of assignments s and s′

which agree on the free variables ofϕ; it then follows, for each such pair, that for any

c in D, α |= ϕ ]s[ cv iff α |= ϕ ]s[ c

v′ , and from this it follows that for any pair s and s′

which agree on the free variables of∃vϕ: α |= ∃vϕ [s] iff

α |= ∃vϕ [s′]. The proof is similar for case (8).

The following two corollaries are immediate.

Corollary 17. Ifσ is a sentence, then for any two assignmentss ands′ : α |= σ [s]

iff α |= σ [s′].

34.

Corollary 18. Ifσ is a sentence, then for every structureα, α |= σ[s] for everys iff α

|= σ[s] for somes.

Further comments and definitions. Thus, for a sentencein L , we can now

define: α |= σ to mean thatα |= σ[s] for all s (iff α |= σ[s] for some s). In this case,

we say thatσ is trueof α. If α |≠ σ, then for no assignment s can we haveα |= σ[s],

and we say thatσ is falsefor α.

For a wff ϕ which is not closed, the statement that “ϕ is true ofα” is

sometimes used to mean thatα |= ϕ [s] for all assignments s. In this case, whereϕ is

not closed, if we letϕ* be a sentence obtained by prefixing universal quantifiers toϕ

for all the variables free inϕ, we have that “ϕ is true ofα” iff α |= ϕ*.

For any setΦ of sentencesof L , (whereΦ is possibly infinite), we defineα |=

Φ to mean thatα |= σ for every sentenceσ in Φ, and we then say thatα satisfiesΦ.

Equivalently, we say thatα is a model forthe set of sentencesΦ.

Proofs about satisfaction. Our mathematical definition of satisfactionallows

us to prove, as a theorem of mathematics, that a given structureα satisfies (or does

not satisfy) a given wff under a given assignment s. We give a simple example: Letα

= (R, <R); and letσ be the sentence∃x∀y[yPx]. We shall prove that the set of all s

such thatα |= σ [s] is empty and hence conclude thatσ is false ofα. Observe that the

subformula tree forσ has 3 nodes. Starting at the bottom, we consider, at each node,

the set of satisfying assignments for that node:

Bottom nodeϕ0 = [yPx]: Here we have Sα(ϕ0) = {s∈Aα| s(y) <R s(x)}.

Next nodeϕ1 = ∀y[yPx]: Here we have Sα(ϕ1) = {s∈Aα| for all c in R,

)y(scy <R s(x)}. From the mathematical definition of <R, we see that this set is

empty.

35.

Final nodeϕ2 = ∃x∀y[yPx]: Here we have Sα(ϕ2) = {s∈Aα| for some

d in R, dxs ∈ Sα(ϕ1)}. Since Sα(ϕ1) is empty, Sα(ϕ2) must be empty. Henceα |≠ σ.

Semantical equivalence:Let ϕ andψ be given wffs (not necessarily

sentences.) We say thatϕ andψ are semantically equivalentif for everystructureβ,

Sβ(ϕ) = Sβ(ψ); that is to say,ϕ andψ are semantically equivalent if, for every

structureβ, ϕ andψ are satisfied by exactly the same assignmentsfor β; or

equivalently, if for everyβ and every assignment s forβ, β |= ϕ [s] iff β |= ψ [s)].

Theorem 19. If given wffsϕ andψ are semantically equivalent, it follows that if a

wff θ has a given occurrence ofϕ as a subformula, and ifθ′ is the result of

substitutingψ for that occurrence ofϕ, thenθ andθ′ are semantically equivalent. (In

particular, ifθ andθ′ are sentences, then for every structureβ: β |= θ iff β |= θ′ .)

Proof.For any given structureβ, and for any given wffθ, the theorem is true

by the exchange principle for tree-induction.

Let α be a given structure. We say that given wffsϕ andψ areα-equivalentif

Sα(ϕ) = Sα(ψ), that is to say, if for every assignment s forα, α |= ϕ [s] iff α |= ψ [s].

Theorem 20. Ifϕ andψ are α-equivalent, it follows that if a wffθ has a given

occurrence ofϕ as a subformula, and ifθ′ is the result of substitutingψ for that

occurrence ofϕ, thenθ andθ′ are α-equivalent.(In particular, ifθ andθ′ are

sentences, then:α |= θ iff α |= θ′.)

Proof.As for Theorem 18.

36.

Theorem 21 . The following semantical equivalences hold. (This is a partial list of

well-known examples.) In each case, the equivalence holds for any choices of the

indicated subformulas.

(1) [ϕ↔ψ] eq [[ϕ→ψ]∧[ψ→ϕ]].

(2) [ϕ→ψ]eq [¬ϕ∨ψ].

(3) ∀vϕ eq ¬∃v¬ϕ.

(4) ∃vϕ eq ¬∀v¬ϕ.

(5) ¬[ϕ∧ψ] eq [¬ϕ∨¬ψ]. [(5) and (6) are known as

(6) ¬[ϕ∨ψ] eq [¬ϕ∧¬ψ]. deMorgan’s laws.]

(7) ¬¬ϕ eq ϕ.

(8) [ϕ∧ψ] eq [ψ∧ϕ]. [(8) and (9) are

(9) [ϕ∨ψ] eq [ψ∨ϕ]. commutativity laws.]

(10) [ϕ∧[ψ1∨ψ2]] eq [[ϕ∧ψ1]∨[ϕ∧ψ2]]. [ Distributivity law.]

(11) [ϕ∨[ψ1∧ψ2]] eq [[ϕ∨ψ1]∧[ϕ∨ψ2]]. [ ′′ ′′ .]

(12) [ϕ1∧[ϕ2∧ϕ3]] eq [[ϕ1∧ϕ2]∧ϕ3]. [Associativity law.]

(13) [ϕ1∨[ϕ2∨ϕ3]] eq [[ϕ1∨ϕ2]∨ϕ3]. [ ′′ ′′ .]

(14) ∃v[ϕ∨ψ] eq [∃vϕ∨∃vψ].

(15) Provided thatv does not occur free inϕ:

∃v[ϕ∧ψ] eq [ϕ∧∃vψ].

(16) Provided thatv does not occur free inϕ:

∃vϕ eq ϕ.

(17) [u=v] eq [v=u].

(18) Let ϕ have a free occurrence ofv but no bound occurrences ofu andv,

37.

and defineϕ uv to be the result of substitutingu for all occurrences ofv

in ϕ. Then:

∃v[[u=v]∧ϕ] eq ϕ uv .

(19) Let ϕ have no occurrences ofu and letϕ vu be as in (18). Then

∃vϕ eq ∃uϕ vu , [rules foralphabetic change

∀vϕ eq ∀uϕ vu . of bound variable]

Proof.The proof for each equivalence uses ordinary mathematical reasoning

together with the definition of satisfiabilityas given above. For example, for (7) we

have:β |= ¬¬θ[s] ⇔ β |≠ ¬θ[s] ⇔ β |= θ[s]; similarly, for (14), we have:β |=

∃v[ϕ∨ψ][s] ⇔ β |= [ϕ∨ψ][s vc ] for some c⇔ for some c, either:β |= ϕ [sv

c ] or β |=

ψ[svc ] ⇔ either: for some c,β |= ϕ[sv

c ] or for some c,β |= ψ[svc ] ⇔ either:β |=

∃vϕ[s] or β |= ∃vϕ[s] ⇔ β |= [∃vϕ∨∃vψ][s].

Theorem 22. The followingα-equivalences hold forα = (R, <R) ):

(20) ¬[u=v] eq. [[uPv]∨[vPu]] .

(21) ¬[uPv] eq. [[u=v]∨ vPu]] .

Proof.As in Theorem 21, but using the specific structureα.

Definition: For any given structureβ, let Tβ = { σ | σ is a sentence ofL and

β |= σ}. T β is called thefirst-order theory of the structureβ.

Remark. Is there an algorithm for deciding, for any given pair of wffs inL , whether

or not that pair are semantically equivalent? The answer is NO. If two wffs happen

to be semantically equivalent, can we always find an elementary proof, in terms of

38.

assignments, for this fact? The answer is YES. If two wffs happen notto be

semantically equivalent, can we always find a proof, at some mathematical level, of

this fact. The answer is NO. The affirmative answer to the second of these questions

will follow from the principal theorem of §7 below.

39.

§5. A DECISION PROCEDURE FOR Tαααα, WHERE αααα = (R, <R).

We first enlargeL to a new languageL + by adding two new basic symbols: t

and f , by including the strings [t] and [f] as atomic wffs, and by augmenting the

definition of satisfactionto include: Sα([t]) = Aα and Sα([f]) = ∅ (the empty set.)

The decision procedure: Given an arbitrary sentenceσ of L, we use some of

the equivalences (1) - (21) above to transformσ into a succession ofα-equivalent

sentences inL + as follows:

(A) Use (1) and (2) to eliminate↔ and→.

(B) Use (3) to eliminate∀.

(C) Choose a subformula∃vθ, whereθ, considered by itself, has no

bound occurrences of any variables. We proceed to “eliminate” this occurrence of∃v

by a chain of equivalences as described in (D) - (I):

(D) Use (5), (6), and (7) to distribute any¬ symbols intoθ and to

remove any pairs¬¬.

(E) Use (20) and (21) to remove any remaining¬ symbols.

(F) Let θ′ be the result of (D) and (E) onθ. Use (8), (9), and (10) to

expressθ′ as a repeated disjunction of repeated conjunctions.

(G) Use (12) and (13) to express this disjunction as

[ϕ1∨[ϕ2∨[ϕ3∨...∨[ϕk-1∨ϕk]...]]] and to express each conjunctionϕi as

[ψi,1∧[ψi,2∧...∧[ψi,m-1∧ψi,m]...]] where all theψi,j containing v come last.

40.

(H) Use (14) and (15) to distribute∃v through this disjunction and, as

far as possible, through each conjunction. This may create additional occurrences of

∃v.

(I) Use (16), (17), and (18) together with the following α-

equivalences to complete the elimination of all the above occurrences of∃v. (This

completes (C) for its given occurrence of∃v and reduces by one the total number of

quantifiers appearing after (B).

(22) ∃v[v=u] eq [t].

(23) ∃v[vPv] eq [f].

(24) ∃v[[vPu1]∧[ ... ∧[vPuk]] ..] eq [t].

(25) ∃v[[w 1Pv]∧[ ... ∧[wmPv]]..] eq [t].

(26) ∃v[[[w 1Pv]∧... [wmPv]] ∧ [[vPu1]∧... [vPuk]]] eq

[[[w 1Pu1]∧...∧[w1Puk]]∧...∧[[w mPu1]∧...∧[wmPuk]] .

(J) In this way, repeating (C) as needed, we can eliminate all

occurrences of∃. The closed wff which remains must have [t] and [f] as its only

atomic subformulas. We can now use the following equivalences to reduce this wff

to a single atomic wff, which must be [t] or [f].

(27) [ϕ∧[t]] eq. ϕ.

(28) [ϕ∨[t]] eq. [t].

41.

(29) [ϕ∧[f]] eq. [f].

(30) [ϕ∨[f]] eq. ϕ.

(31) ¬[f] eq. [t].

(32) ¬[t] eq. [f].

(K) If the final wff (of L +) is [t], we see that Sα(σ) = Sα([t]) = Aα and

hence thatα |= σ, andσ is in Tα. If the final wff is [f], we see that Sα(σ) = Sα([f]) =

∅ and hence thatα |≠ σ, andσ is not in Tα.

Example. We apply the procedure toσ = ∀x∀y[[xPy]∨[yPx]]. For ease of

reading, we omit brackets whose presence in the underlying unabbreviated wff is

clear from context. Main stages of the procedure are indicated on the left. A few

numerals from Theorem 20 are also shown.

(A) not applicable

(B) ¬∃x¬¬∃y¬[ … ]

(C) Move to eliminate∃y.

(D) ¬∃x∃y[¬[xPy]∧¬[yPx]] {(5)(7)}

(E) ¬∃x∃y[[x=y ∨ yPx]∧[y=x ∧ xPy]]

(F)(G) ¬∃x∃y[ [x=y ∧ y=x]∨[yPx ∧ y=x]∨[x=y ∧ xPy]∨[yPx ∧ xPy] ]

(H) ¬∃x[ ∃y[x=y∧y=x] ∨ ∃y[yPx∧y=x] ∨ ∃y[x=y∧xPy] ∨ ∃y[yPx∧xPy] ]

(I) ¬∃x[ [x=x] ∨ [xPx] ∨ [xPx] ∨ [xPx] ] {(18); (8)(18); (17)(18); (26)}

42.

(C) Move to eliminate∃x.

(H) ¬[ ∃x[x=x] ∨ ∃x[xPx] ∨ ∃x[xPx] ∨ ∃x[xPx] ]

(I) ¬[ t ∨ f ∨ f ∨ f ] {(22);(23);(23);(23)}

(J) ¬[t] (30)

(J) [f] (32)

(K) We conclude thatσ is not in Tα.

Remarks. The algorithm described above is said to “solve the decision

problem for Tα with α = (R, <R)”. The general method of this decision procedure is

known as the “elimination of quantifiers method”. Unfortunately, this algorithm is

“slow” in the sense that it requires exponential time to complete its calculations, No

“fast” (polynomial time) algorithm is known for this decision problem.

43.

§6. THE LANGUAGES P AND 2P

The languageL is commonly known as the language offirst-order logic with

identity for a single binary relation.So far, we have presented the syntax and

semantics ofL . We next present the syntax and semantics of a language which we

shall callP. P is commonly known as the language ofpropositional logic.

The syntax of P.As with L , we begin with a finite alphabet ofbasic symbols.

These are: p q r variable symbols

′ prime

| vertical bar

¬ negation

∧ ∨ → ↔ connectives

[ ] brackets

As with L , astring is defined to be a finite (possibly empty) sequence of

basic symbols, and avariable is defined to be a string consisting of a variable symbol

followed by a finite number (possibly zero) of primes followed by a single vertical

bar. AnN-string is a possibly empty string composed entirely of negations. For every

variable v, the string composed as [v] is anatomic formula. A set A of strings is

admissibleif it is closed under the following three closure rules:

(1) Every atomic formula is inA. (HenceA must be infinite.)

(2) If string S is inA, then the string composed as¬S must be inA.

(3) If the strings S1 and S2 are inA, then so also must be the strings composed

as [S1∧S2], [S1∨S2], [S1→S2], and [S1↔S2].

44.

Well-formed formulas: Let SP be the set of all strings of basic symbols forP.

SP is an admissible set. LetWP be the intersection of all admissible subsets ofSP.

ThenWP is itself admissible and is called the set ofwell-formed formulas(“wffs”) of

P. Example: [[[p|]→[q′|]]→[r′′|]] . Henceforth, we will usually abbreviate wffs by

omitting vertical bars and brackets in each atomic formula and by using subscript

numerals for each string of primes (the preceding example would be abbreviated:

[[p→q1]→r2].)

A first inductive principleholds forP just as forL . A bracket-countfor a

string inP is defined exactly as forL . Subformulasare defined as forL . Theorem 1,

Corollary 2, and Theorem 3then hold word-for-word forP, and their proofs are the

same as forL . Corollary 4also holds with the words “a quantification” deleted.

Subformula occurrences, andsubformula treesare defined forP as forL , as

arelength, depth, and rank.Theorem 5, Corollary 6, and the second inductive

principlehold for P just as forL . Definition by tree-inductionis carried out forP as

for L , except that the twodefining functionsh∃ and h∀ are omitted. Theorem 7holds

for P as forL , except that the reference to “eight” defining functions becomes a

reference to “six”. Moreover, the principle of tree-inductionand the exchange

principle for tree-inductionhold for P exactly as forL .

Decision procedures for wffs inP. Theorems 8, 9, and 10, along with

Corollary 11, Theorem 12, and Lemmas 13and 14are proved forP as forL , but with

N-stringsin place ofNQ-strings.

The semantics of P.In the semantics ofP, we have no counterpart to the

concept ofstructurein the semantics ofL . Instead, we only use assignments, where

45.

anassignment(for P) is a function s:VP → {0,1}, with VP = the set of all variables in

P. We can think of this function s as assigning “truth” or “falsity” to every variable in

P, where, for a variable v, s(v) = 1 indicates that v is assignedtruth and s(v) = 0

indicates that v is assignedfalsity. In connection withP, the integers 0 and 1 are

sometimes referred to astruth-values.

We use tree-induction to define, for every wffθ, S(θ) = the set of assignments which

satisfyθ. Let AP be the set of all assignments. The tree-induction for S goes as

follows: (1) ϕ = [v]. Then S(ϕ) = {s ∈ AP | s(v) = 1},

(2) S(¬ϕ) = {s ∈ AP | s∉ S(ϕ)},

(3) S([ϕ∧ψ]) = S(ϕ) ∩ S(ψ),

(4) S([ϕ∨ψ]) = S(ϕ) ∪ S(ψ),

(5) S([ϕ→ψ]) = S(ψ) ∪ {s ∈ AP | s∉ S(ϕ)},

(6) S([ϕ↔ψ]) = (S(ϕ)∩S(ψ))∪({s∈AP|s∉S(ϕ)} ∩{s∈AP|s∉S(ψ)}).

Let s be an assignment, and letϕ be a wff. If s∈ S(ϕ), we say that ssatisfies

ϕ, and we write: |=ϕ[s]. Moreover, for each assignment s, we define a function

s*: WP → {0,1} as follows: s*(ϕ) = 1 if |= ϕ[s], and s*(ϕ) = 0 if |≠ ϕ[s]. Thus s

satisfiesϕ if s*(ϕ) = 1, and s does not satisfyϕ if s*(ϕ) = 0.

Theorem 23. If assignmentss ands′ (for P) agree on the variables of a wffθ (of P),

thens*(θ) = s′*(θ), that is to say: |= θ[s] iff |= θ[s′].

Proof.For any wffϕ, cases (1) to (6) above enable us to define the functions

s* and s′* on the subformula tree ofϕ by tree-induction. Since, by hypothesis, s* and

s′* must agree on the terminal elements of this tree, we must have s*(ϕ) = s′*(ϕ).

46.

Semantical equivalenceis defined forP in the same way as forL . We say that

wffs ϕ andψ are semantically equivalent if S(ϕ) = S(ψ), and an exact analogue to

Theorem 19 is immediate. Furthermore, the semantical equivalences (1), (2), and (5)-

(13) in Theorem 21 are also immediate.

The truth-tablealgorithm. Let s be an assignment, and letϕ be a wff. If we

know the values of s(v) for each variable v inθ, we can calculate s*(ϕ) by a simple

algorithm. Consider the subformula tree ofθ. We assign the value s*(ϕ) to each node

ϕ on this tree by the following inductive procedure. Each terminal node (in the tree)

is an occurrence of a variable inθ. To each occurrence of a variable v as a terminal

node, we assign the value s*(v) = s(v).. The assignment of 0 or 1 to successor nodes

in the tree is then uniquely determined and easily calculated by cases (1) – (6) above.

The algorithm is known as thetruth-table algorithm, because each of the conditions

(2) – (6) can be described by a simple table of values; for example:

ϕ ψ ϕ → ψ

1 1 1

1 0 0

0 1 1

0 0 1 .

Definitions. If a wff θ of P has s*(θ) = 1 for all assignments s inAP, we say

thatθ is valid. If s*(θ) = 1 for someassignment s inAP, we say thatθ is satisfiable.A

wff of P which is valid is also called atautology.

47.

Theorem 24. There exists a decision procedure for deciding whether or not a given

wff of P is a tautology.

Proof.We use the truth-table algorithm, and carry out the algorithm for each

possible assignment of 0 or 1 to the variables of the given wff. If there are n distinct

variables in the given wff, then 2n applications of the truth-table algorithm will be

required. It is not difficult to show that this procedure has at-least-exponential growth

and hence does not have at-most-polynomial growth. The problem of whether or not

there exists a polynomial-growth decision procedure for tautologies inP is

equivalent to the “P = NP” problem, a major unsolved problem in mathematics at

the present time.

Theorem 25. Letθ be a wff ofP. Then:

(a) θ is valid iff ¬θ is not satisfiable, and

(b) θ is satisfiable iff ¬θ is not valid.

Proof. Immediate.

Definition.Let Φ be a (possibly infinite) set of wffs ofP and letθ be a wff of

P. We say thatΦ semantically impliesθ if every assignment which satisfies all the

wffs in Φ also satisfiesθ, and we express this fact aboutΦ andθ by writing Φ |= θ.

Theorem 26. (The “compactness theorem” forP.) If Φ |= θ, then there must exist a

finite subset∆ of Φ such that∆ |= θ.

(We shall later extend this theorem toL , where it is harder to prove.) This extension

to L is one of the “great theorems” of elementary logic upon which many

applications depend.)

Proof.Let s be an assignment and letΨ be a set of wffs. We write |=Ψ[s] to

mean that |=ψ [s] for every wff ψ in Ψ. To prove a given assertion of the form

48.

“if A then B”, it is enough to prove the equivalent assertion (known as the

contrapositiveof the first assertion) “if not-B then not-A”. In the present case, not-B

asserts that for every finite subset∆ ⊆ Φ, there exists an assignment s such that

|= ∆∪{¬θ}[s], while not-A asserts that there exists an assignment s such that

|= Φ∪{ ¬θ}[s]. We assume thatΦ is infinite. Letϕ0 = ¬θ, and let {ϕ1, ϕ2, … } be a

listing of the wffs ofΦ. For m > 0, defineψm = [ϕ0∧[ϕ1∧[ϕ2∧ … ∧ϕm].]], and, by

assumption, let sm be an assignment such that |=ψm[sm]. Let v1, v2, …be a list of all

the variables ofP (for example, p, q, r, p′, q′, …). For any given m, let nm be the

maximum value of n such that vn occurs inψm. Let k(m) = max{m, nm}. Let ms be

the finite assignment defined on the domain {v1, v2, … vk(m)} such that for all i <

k(m), )v(s)v(s imim = . Note that 'mm sands need not agree on their common

domain, since sm and sm′ may differ. Note also that as m varies, there are infinitely

many distinct finite mappings sˆ m. We define an assignment s inductively as follows:

Basis step.s(v1) = 0 if {m | s m(v1) = 0} is infinite; and s(v1) = 1 otherwise. In

the latter case {m | sˆ m(v1) = 1} must be infinite.

Induction step.s(vk+1) = 0 if {m | for i < k, sm(vi) = s(vi) and sm(vk+1) = 0} is

infinite; and s(vk+1) = 1 otherwise. In the latter case, {m | for i <k, sm(vi) = s(vi) and

sm(vk+1) = 1} must be infinite).

From this construction it follows directly that |=ψm for each m, and hence

that |=Φ[s] and |=¬θ[s]. This proves the theorem.

We now extendP by introducing quantifiers over the variables ofP. The

resulting language is2P,commonly known as the language ofsecond-order

propositional logic

49.

The syntax of 2P. We enlargeP in a straightforward way by adding∃ and∀

as new basic symbols. We defineadmissiblesets for2P by adding a fourth closure

rule:

(4) If u is a variable and if the string S is in an admissible setA, then the

strings composed as∃uS and∀uS must also be inA. The wffs of2P are then defined

as the members of the intersection of all admissible sets. Thefirst induction principle

holds as forP. Subformulasandsubformulatrees are defined as before, and

analogues of Theorems, Corollaries, and Lemmas 1-14 are easily proved.NQ-strings

are defined as forL , and free and bound occurrences are defined as before.

The semantics of 2P.The set of assignments for2P is the same as the setAP

defined forP. The set S(θ) of all assignments satisfying a given wffθ is defined by a

tree induction which uses the same rules (1) – (6) as forP togther with the rules:

(7) S(∃uϕ) = {s∈AP | either 1u

0u sors is in S(ϕ)}.

(8) S(∀uϕ) = {s∈AP | both 1u

0u sands are in S(ϕ)}. .

As before, we write |=ϕ[s] for s satisfiesϕ. Free and bound occurrences of

variables, andsentences, are defined as forL . Theorem 23 holds for2P and is

proved in the same way as froL . Validity andsatisfiabilityof sentences are defined

as forL , and analogues to Theorem 16 and Corollaries 17 and 18 [with references to

structureα deleted] are proved in the same way as before. Finally,semantical

equivalencesare defined as forL , and the equivalences (1) – (16) and (19) of

Theorem 21 are proved for2P in the same way as before.

Reading wffs. A subformula of the form∃vθ can be read as “there exist a

truth-value for v such thatθ (is true)”. Similarly,∀vθ can be read as “for either truth-

50.

value of v,θ (is true).

A decision procedure for the valid sentences of2P. As we have noted, there

is no decision procedure for the valid sentences ofL . If we try elimination of

quantifiers as in§5,we find that at stage (I) we have no rules for proceeding further.

For the case of2P, however, we have such rules and can get a decision algorithm. To

carry out this algorithm, we extend the language2P to the language2P+ by adding

the atomic wffs [t] and [f] with the semantic rules: S([t]) =AP and S([f]) =∅. We

then see that:∃u[u] eq. [t],

∃u[v] eq [v] for v different from u,

∃u¬[u] eq. [t],

∃u¬[v] eq [v] for v different from u,

∃u[[u]∨¬[u]] eq. [t],

∃u[[u]∧¬[u]] eq. [f].

Example. We are given:∀p∃q∀r[[p→q]→r] (with brackets omitted as

usual).We proceed in the standard way.

¬∃p¬∃q¬∃r¬[¬[¬p∨q]∨r]

………….[[p∧¬q]∨r]

……..∃r[[¬p∨q]∧¬r]

……… ∃r[[¬p∧¬r]∨[q∧¬r]]

51.

……..[[¬p∧∃r¬r] ∨[q∧∃r¬r]]

……..[[¬p∧t]∨[q∧t]]

…∃q¬[¬p∨q]

…∃q[p∧¬q]

¬∃p¬[p∧∃q¬q]

¬∃p¬[p∧t]

¬∃p¬p

¬t

f

This decision procedure for2P can also be used for the languageP. Let ϕ be a wff of

P, and let v1, … vk be the distinct variables inϕ, listed in alphabetical order. (This

order was described in Theorem 26.) Then the sentence of2P written as

∀v1∀v2…∀vkϕ is called theuniversal closureof ϕ, and the sentence written as

∃v1∃v2…∃vkϕ is called theexistential closureof ϕ. When we apply the decision

procedure of2P to the universal closure ofϕ, we have a single computation which

produces “t” if and only ifϕ is a tautology inP. Similarly, applying it to the

existential closure ofϕ, we get “t” if and only ifϕ is a satisfiable wff inP.