As mentioned in the beginning, we recognize logic as a tool for analyzing thoughts and realizing truths. But what is truth? Philosophers, and even mathematicians, have sought the answer for centuries. For a satisfactory answer, at least in propositional logic, the concept of truth coincides with that of tautology. If we take a deeper look at tautologies, we conceive that their truth values are 1 (true), independent of any particular truth assignments. Hence it suits perfectly with our feelings about truth — always true.
More precisely, in the process of discovering truth or deduction, we usually assume that certain conditions (possibly none), called premises, hold. Then we successively get the result or conclusion that follows from such assumptions by those justified inference rules. Symbolically, it states
(ϕ0 ∧ . . . ∧ ϕn−1)⇒ ϕ,
where those ϕi, 0≤ i ≤ n − 1, are premises, and ϕ is the conclusion. The conjuction 5 of those
5From the associative laws there is no ambiguity to write propositions in conjuntion without parentheses.
premises is called hypothesis. We use ‘⇒’ to denote that ϕ is deduced from ϕi’s.
For a set Δ of propositions, we write Δ |= ϕ to denote that ϕ is a conclusion given the propositions in Δ as premises and we say that ϕ is a consequence of Δ.
Actually, given ϕi’s and ϕ, there is a simple method to decide whether the argument, i.e.
the equation shown above, is correct (in which case we say the argument is valid). What we need to do is to show that the implication
((ϕ0∧ . . . ∧ ϕn−1)→ ϕ)
is a tautology. This method is justified by Tarski’s deduction theorem. Intuitively, it is not hard to see the correctness of this method: Since we assume those premises to hold, if the conclusion holds as well, then the truth value of the implication evaluates to 1; if otherwise some premise fails to hold, then the truth value of the implication also evaluates to 1, no matter whether the conclusion holds or not. This reminds us of tautology in some way.
It is not hard to decide whether a given proposition is a tautology, as we have seen: the truth table method, which suffices to decide all tautologies. Thus in the viewpoint of computer science, concerning the language tautology that consists of all tautologies in propositional logic, we have
Lemma 2.5: tautology is decidable.
However, the drawback of the method of truth table is apparent: it is a tedious work and is inefficient and impractical for large number of variables appearing in the proposition. (See Lemma 2.2.)
Fortunately, we are equipped with useful rules discussed earlier (the laws for equivalent propositions), which reduce a great deal of effort of constructing the truth table most of the time, since they can be used to transform a complicated proposition into a simplified equivalent one.
A subtlety is in order: Let an implicationχ be equivalent to a proposition ψ. If we added ψ as an additional premise, then the new implication χ would be a tautology, i.e. the argument would be valid. The reason is clear: Whether χ is valid depends on whether or not the truth value ofψ is 1, if we assume that to be 1 as our additional premise, then the augument is valid.
Lemma 2.6: Let ((ϕ0 ∧ . . . ∧ ϕn−1)→ ϕ) be an implication equivalent to some proposition ψ. Then ((ϕ0∧ . . . ∧ ϕn−1∧ ψ) → ϕ) is a tautology.
Proof:
(((ϕ0∧ . . . ∧ ϕn−1)→ ϕ) ∨ ¬ψ)
≡ ((¬ϕ0∨ . . . ∨ ¬ϕn−1∨ ϕ) ∨ ¬ψ) (DeMorgan’s law applied several times)
≡ ((¬ϕ0∨ . . . ∨ ¬ϕn−1∨ ¬ψ) ∨ ϕ) (associative law and commutative law)
≡ (¬(ϕ0∧ . . . ∧ ϕn−1∧ ψ) ∨ ϕ) (DeMorgan’s law applied several times)
≡ ((ϕ0∧ . . . ∧ ϕn−1∧ ψ) → ϕ).
On the other hand, there is an alternative method which provides ‘formal’ proofs that are reminiscent of mathematical proofs for valid arguments: deduction system. There are four common deduction systems: axiom system, sequent calculus, natural deduction and analytic tableau. The method of deduction system is highly syntactic and more machine-oriented, and is suitable for valid arguments only, i.e. it cannot determine those invalid arguments. We shall briefy introduce axiom system, which is purely syntactic.
First of all, the term “axiom” should not be strange to us: it is fundamental to the study of mathematics and even physics. Take Euclidean geometry for an example, one of its axioms states “given an (infinitely long) line on a plane, and a point on the same plane but not on this line, there is exactly one line on the same plane that passes through the given point and is parallel to the given line.” Another example arises from physics: That “the speed of light in absolute vacuum is a constant, independent of any frame of inertia” is an axiom in Einstein’s relativity theory.
Definition 2.8: [11] A proof for an argument
(ϕ0∧ . . . ∧ ϕn−1)⇒ ϕ is a sequence ψ0, . . . , ψm, ψ where
ψ := ((ϕ0∧ . . . ∧ ϕn−1)→ ϕ),
and each ψi, 0≤ i ≤ m is an axiom of the system or a proposition generated according to the inference rules of the system.
(Note that these axioms are just like premises of another argument where the conclusion is the original argument.)
If there is a proof for a proposition ϕ, then we say ϕ is a theorem and is derivable and we write ϕ.
Given a set Δ of propositions, if a proposition ϕ is derivable regarding those in Δ as additional axioms, then we say ϕ is a Δ-theorem and is derivable from Δ and we write Δ ϕ.
The notion Δ ϕ is the syntactic counterpart of Δ |= ϕ.
Definition 2.9: [6] A set Δ is consistent iff Δ false.
The following two theorems together state that the notion of consequence and that of derivability coincides in propositional logic:
Theorem 2.1: [soundness theorem], [10] If Δ ϕ, then Δ |= ϕ. Theorem 2.2: [completeness theorem], [10] If Δ|= ϕ, then Δ ϕ.
For more on axiom systems, see [12]. For more on soundness and completeness theorems, see [10].
Chapter 3
Topics on Predicate Logic
All is well so far. Propositional logic possesses many good properties as we have seen in previous chapter. But let us examine the implication below, Aristotle’s well-known syllogism:
1. (Premise) All humans are mortal.
2. (Premise) Socrates is a human.
3. (Conclusion) Socrates is mortal.
This implication is evidently correct, since the conclusion is just an instantiation of the first premise by the second premise. If we symbolize this implication as shown below, however, we will be surprised that it is not a tautology, which stands for truth in propositional logic:
((p0∧ p1)→ p2), where
(a) p0: “All humans are mortal,”
(b) p1: “Socrates is a human,”
(c) p2: “Socrates is mortal.”
We see from this example that there is a flaw in propositional logic: There is no way to express single objects (e.g. ‘Socrates’ in our previous implication), along with their attibutes
such as states and relations. Thus, we must enlarge our language with some additional elements to encompass such statements — hence predicate logic. In the next section, we shall introduce the simplest part, first-order logic.
3.1 First-order Logic
First-order logic is more complicated than propositional logic. Informally, First-order logical statements (so-called formulae) are similar to propositions: They can be decided to whether hold or not (just like propositions can be decided to be whether true or false) and can be connected by logical connectives just like propositions. But additionally, they can be preceded by the so-called quantifiers (‘∀’ and ‘∃,’ hence we sometimes refer to predicate logic as quan-tificational logic) and, more importantly, the basic parts of them, i.e. the atomic formulae (analogous to propositional variables), consist of statements about single objects — a com-bination of predicate symbol and terms, — which in contrast are the key improvements on propositional logic. (Recall that propositional variables cannot be further divided into smaller parts.)
3.1.1 Syntax
Definition 3.1: [6, 8] The alphabet of the language of first-order logic is the set that consists
of
(a) first-order variables: v0, v1, . . . ;
(b) (i) a (possibly empty) set K of constant symbols: c0, c1, . . . ;
(ii) a (possibly empty) set Φn of n-ary function symbols for each n ∈ Z+; (iii) a (possibly empty) set Πn of n-ary relation symbols for each n ∈ Z+; (c) quantifiers: ∀, ∃;
(d) logical connectives: ∧, ∨, ¬, →, ↔;
We shall denote Φ :=
n∈Z+Φn and Π :=
n∈Z+Πn. Note that Π= ∅ as the equality symbol
‘=’ (a binary relation symbol) is a member of Π. Relation symbols are often called predicate symbols, or predicate for short. And some regard constants as nullary functions. Also, the language of first-order logic as well as of others in predicate logic, may or may not contain the binary predicate ‘=,’ depending on the topics we are speaking about. (Predicate logic without
‘=’ is sometimes called specialized predicate logic, whereas that with it is sometimes callled generalized logic. For more topics on this, see [9, 10].) We shall include it in our language.
Definition 3.2: [8]
(a) Each variable (v0, v1, . . . , or x, y, . . . ) is a term;
(b) Each constant symbol is a term;
(c) If t0, . . . ,tn−1 are terms and f is an n-ary function symbol, then so is ft0. . . tn−1. We shall often write f(t0, . . . , tn−1) for ft0. . . tn−1.
Definition 3.3: [8]
(a) If t0, . . . ,tn−1 are terms and R is an n-ary relation symbol, then Rt0. . . tn−1 is an (atomic) formula;
(b) If ϕ is a formula, then so is ¬ϕ;
(c) If ϕ and ψ are formulae, then so are (ϕ ∧ ψ), (ϕ ∨ ψ), (ϕ → ψ) and (ϕ ↔ ψ);
(d) If ϕ is a formula and x is a variable, then ∀xϕ and ∃xϕ are also formulae.
In the following, we list the name of each quantifier and the way to pronounce them: [10]
symbol name pronunciation
∀ universal quantifier for all, for any, . . .
∃ existential quantifier there exists . . . such that, there is . . . such that, . . .
We shall often writeR(t0, . . . , tn−1) forRt0. . . tn−1. In particular, for binary predicate, we often write t0Rt1 (infix form) instead of Rt0t1 (prefix form). Note that these alternative forms of terms and formulae are just for ease of reading, by definition they are not terms and formulae, respectively.
The polish notation applies to first-order logic (actually, predicate logic) as well, just re-gard each atomic formula or quantified formula (those that are preceded by quantiers) as a propositional variable.
Now we are ready to convert those colloquial statements to ones in our formal language.
For example,
“For every pair x, y, if x < y then f(x) < f(y).”
can be converted to
∀x∀y(x < y → f(x) < f(y)).
We say an occurrence of a variable x is bound in ϕ iff it is quantified, i.e. there is ‘∀x’ or
‘∃x’ that applies to it; otherwise it is called free. More precisely, in the following formula:
(∀xx = x ∧ x = f(y)),
the first two occurrences of x (in ‘x = x’) are bound (we do not recognize the x in ‘∀x’ as an occurrence of x as it is part of the package ‘∀x’), whereas the third occurrence of x (in
‘x = f(y)’) is free. Note that quantifiers only apply to the formula that immediately follows.
Likewise, they in the above formula is also free. A variable is bound if it has no free occurrences, otherwise it is free. A formula without free variable is called a sentence. Sincex and y are free in the above formula, i.e. they have free occurrences, this formula is not a sentence.
Definition 3.4: [6] A formula ϕ is in prenex normal form iff it is of the form Q0. . . Qn−1ψ,
where Qi’s are packages of the form ‘∀x’ or ‘∃x’ and ψ is a quantifier-free formula, called the ϕ.
It is clear that our new alphabet is also countable, though we add some elements to it.
Since the set of all formulae are defined as strings over the alphabet according to the formation mentioned above, we have the following lemma, analogous to Lemma 2.1:
Lemma 3.1: The set of all formulae is countable.
3.1.2 Semantics
Until now, terms and formulae are merely strings (of special kinds) over the alphabet. We shall introduce their meanings. The semantic aspect of predicate logic is somewhat complicated.
First, we are given a nonempty set D, called domain (or universe), of which we map each variable x in our alphabet to some element. It is similar to {0, 1} given in propositional logic.
Furthermore, we map each constant, function symbol and relation symbol to actual element, function and relation, respectively, over the domain D, except that ‘=’ is always mapped to {(e, e)|e ∈ D}. We shall denote the mapping from variables to elements in D (called an assignment) as β, and denote the mapping from constants, function symbols and relation symbols to those actual objects over D (called a structure) as A. We shall often write fA (or fD), cA (or cD), and RA (or RD) instead of A(f), A(c) and A(R), respectively. We have the following definition:
Definition 3.5: [8] An interpretation I for a given domain D is a pair (A, β) that consists of a structure A and an assignment β.
Intuitively, an interpretation in predicate logic is the counterpart of a truth assignment in propositional logic. For the meanings of terms, given an interpretationI, we have the following definition:
Definition 3.6: [the meaning of a term], [6]
(a) For a variable x, I(x) := β(x);
(b) For a constant c, I(c) := cA;
(c) For an n-ary function symbol f applied to n terms t0, . . . , tn−1, I(ft0. . . tn−1) :=fA(I(t0), . . . , I(tn−1)).
Hence the meanings of terms and atomic formulae (for Rt0. . . tn−1, its meaning is thus RA(I(t0), . . . , I(tn−1)), given I) are well-defined. Just as in propositional logic, we shall define the notion of satisfaction of I to a formula ϕ below:
Definition 3.7: [8]
(a) For atomic formula Rt0. . . tn−1,I |= Rt0. . . tn−1 :iff RA(I(t0), . . . , I(tn−1));
(Note that we stipulate that “=A:={(e, e)|e ∈ D},” so “I |= t0 =t1 :iff I(t0) = I(t1).”) (b) I |= ¬ϕ :iff I |= ϕ;
(c) I |= (ϕ ∧ ψ) :iff both I |= ϕ and I |= ψ;
(d) I |= (ϕ ∨ ψ) :iff I |= ϕ or I |= ψ (inclusively);
(e) I |= (ϕ → ψ) :iff if I |= ϕ then I |= ψ;
(f) I |= (ϕ ↔ ψ) :iff I |= ϕ if and only if I |= ψ.
(g) I |= ∀xϕ :iff for all e ∈ D, Ix→e |= ϕ; 1
(h) I |= ∃xϕ :iff there exists e ∈ D such that Ix→e |= ϕ.
An interpretation I is said to be a model of a formula ϕ iff I |= ϕ. Moreover, for a set Δ of formulae, I is a model of Δ (written I |= Δ) iff I |= ϕ for every ϕ ∈ Δ.
If for Δ and ϕ, every interpretation I which is a model of Δ (I |= ϕ) is also a model of ϕ (I |= ϕ), then we write Δ |= ϕ and say that ϕ is a consequence of Δ. Specifically, if ∅ |= ϕ, i.e. ϕ is satisfied by all interpretations, then we write |= ϕ and say ϕ is a valid formulae (a situation analogous to tautologies in propositional logic). If a formula ϕ is unsatisfiable, i.e. it has no models, then it is equivalent to the negation of a valid formula.
Example 3.1: Let K := ∅, Φ := ∅ and Π := {R, =}, where R is binary. Let I0 and I1 be two interpretations such that:
1Ix→e is justI with the variable x mapped to e
I0 I1
domain {0, 1, 2} {1, 2, 3}
x 0 1
y 1 2
z 2 3
R {(0, 1), (0, 2), (1, 2)} {(1, 2), (1, 3), (2, 3), (3, 2), (3, 1), (2, 1)}
(The mappings of other variables are irrelevant to this example.)
Let
ϕ0 :=R(x, y), and
ϕ1 :=∀x∀y(¬x = y → R(x, y)), then we have:
Is I0 a model? Is I1 a model?
ϕ0 Yes Yes
ϕ1 No Yes
Equivalent Formulae
Analogous to propositional logic, we have the following definition:
Definition 3.8: [8] Two formulae ϕ and ψ are equivalent (written: ϕ ≡ ψ) iff {ϕ} |= ψ and {ψ} |= ϕ.
The laws for equivalent formulae are the same to those for equivalent propositions (without, of course, those that involve true or false), regarding a formulae as a proposition. And additionally, [6, 10]
form note
¬∀xϕ ≡ ∃x¬ϕ generalized DeMorgan’s law for ‘∀’
¬∃xϕ ≡ ∀x¬ϕ generalized DeMorgan’s law for ‘∃’
∀x(ϕ ∧ ψ) ≡ (∀xϕ ∧ ∀xψ)
-∀x(ϕ ∧ ψ) ≡ (∀xϕ ∧ ψ) x does not appear free in ψ
∀x(ϕ ∨ ψ) ≡ (∀xϕ ∨ ψ) x does not appear free in ψ
∀xϕ ≡ ∀yϕ[x ← y] y does not appear in ϕ
(ϕ[x ← y] is ϕ with those free occurrences of x replaced by occurrences of y) We see that ‘∀’
and ‘∃’ are similar to ‘∧’ and ‘∨,’ respectively.
On the other hand, every formula can be transformed into an equivalent formula in prenex normal form (cf. Definition 3.4). See [6, 10].
3.1.3 Deduction Systems
As mentioned in section 2.4, there are four common methods to deduce conclusions given some premises. Note that the method of truth table does not work here, since there are infinitely many possible interpretations. (Recall that in propositional logic, there are only finitely many truth assignments that matter.)
The following definitions are all analogous to those in propositional logic:
Definition 3.9: A proof for an argument2
(ϕ0∧ . . . ∧ ϕn−1)⇒ ϕ
is a sequence ψ0, . . . , ψm, ψ where
ψ := ((ϕ0∧ . . . ∧ ϕn−1)→ ϕ),
and each ψi, 0 ≤ i ≤ m is an axiom of the system or a formula generated according to the inference rules of the system.
2The argument for first-order logic is defined similarly.
(Note that these axioms are just like premises of another argument where the conclusion is the original argument.)
If there is a proof for a formulaϕ, then we say ϕ is a first-order theorem and ϕ is derivable, and we also write ϕ.
Given a set Δ of formulae, if a formula ϕ is derivable regarding those in Δ as additional axioms, then we say ϕ is a Δ-first-order theorem and ϕ is derivable from Δ, and we also write Δ ϕ. Note that a theorem ϕ is also a Δ-first-order theorem by definition. The set Θ of all Δ-first-order theoremsϕ (which are sentences) is called a theory, given Δ. The notation Δ ϕ is the syntactic counterpart of Δ|= ϕ.
There is an interesting application to the research of artificial intelligence: the knowledge base plays the role of Δ, while ϕ denotes the representation of some knowledge. The process for the knowledge base to deduce ϕ (reasoning) is indeed the same as that for Δ ϕ. For more on this issue, see [20].
Definition 3.10: [8] A set Δ is consistent iff there is no contradiction ϕ such that Δ ϕ.
The axiom system given in [6] is shown below:
item form
AX0 Any formula whose propositional form is a tautology.
AX1 Any formula of the following forms:
AX1a t = t, where t is a term.
AX1b ((t0 =t0∧ . . . ∧ tn−1=tn−1)→ ft0. . . tn−1=ft0. . . tn−1), whereti’s are terms and f is an n-ary function symbol.
AX1c ((t0 =t0∧ . . . ∧ tn−1=tn−1)→ (Rt0. . . tn−1 → ft0. . . tn−1)), whereti’s are terms and R is an n-ary relation symbol.
AX2 Any formula of the form (∀xϕ → ϕ[x ← t]).
AX3 Any formula of the form (ϕ → ∀xϕ), with x not free in ϕ.
AX4 Any formula of the form (∀x(ϕ → ψ) → (∀xϕ → ∀xψ)).
(ϕ[x ← t] is ϕ with those free occurrences of x replaced by occurrences of the term t). The formulae shown above are basic axioms. The axiom system contains besides these all those formulae that are preceded by any number of prefixes of the form ‘∀x.’ It is not hard to see that the axioms are valid formulae. The only one inference rule is modus ponens. (See Example 2.3.) Schematically, it states:
ϕ (ϕ → ψ)
ψ .
Here we give an example illustrating the proof under axiom systems:
Example 3.2: The formal proof of the theorem ∃y(x = y) is:
ψ0 :=x = x
In proving a theorem, we often divide it into two or more parts. The correctness of this technique can be justified by the following lemma. (Note that we prove it in the level of metalanguage.)
Lemma 3.2: Let ϕ and ψ be two formulae. Then
( ϕ and ψ) if and only if (ϕ ∧ ψ).
Proof: Suppose that ϕ and ψ, i.e. there are proofs Sϕ andSψ for them. Notice thatϕ and ψ are the last elements of Sϕ and Sψ, respectively. Then Sϕ, Sψ, (ψ → (ϕ → (ϕ ∧ ψ))), (ϕ →
Conversely, suppose that there is a proofS(ϕ∧ψ) for (ϕ∧ψ). Then S(ϕ∧ψ), ((ϕ∧ψ) → ϕ), ϕ and S(ϕ∧ψ), ((ϕ ∧ ψ) → ψ), ψ are proofs for ϕ and ψ, respectively. Hence ϕ and ψ.
Analogous to propositional logic, the following two theorems together state that the notion of consequence and that of derivability coincides in first-order logic:
Theorem 3.1: [soundness theorem], [6] If Δ ϕ, then Δ |= ϕ.
Theorem 3.2: [G¨odel’s completeness theorem], [6] If Δ|= ϕ, then Δ ϕ.
The following theorem, which is a consequence of G¨odel’s completeness theorem, is critical to our main result (Theorem 4.3):
Theorem 3.3: [L¨owenheim-Skolem theorem], [6] If a sentence ϕ has finite models of arbitrary large cardinality (i.e. the size of the domain), then it has an infinite model.
For more complete treatment about this, see [6, 8, 10].
For more on the axiom system, see [6]. [8, 10] are excellent references for other deduction systems. [6, 8, 10] all discuss the theorems above. (However, the proofs of Theorem 3.2 in all of them adopt the one by [13]. For G¨odel’s own proof, see [14].)
3.1.4 Weakness of First-Order Logic
Note that first-order variables are only mapped to the simplest or the individual objects (hence the name first-order) in a structure, whereas the concepts such as functions and relations are objects in second-order. Because of this, there are many (computational) problems that cannot be expressed in first-order logic (our result in the next chapter, for instance). It is the need to represent these complex objects that provokes second-order logic.