Download Syntax and Semantics of Propositional and Predicate Logic

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Abductive reasoning wikipedia , lookup

Law of thought wikipedia , lookup

Rewriting wikipedia , lookup

Ambiguity wikipedia , lookup

Non-standard calculus wikipedia , lookup

Boolean satisfiability problem wikipedia , lookup

Curry–Howard correspondence wikipedia , lookup

Combinatory logic wikipedia , lookup

Quasi-set theory wikipedia , lookup

Intuitionistic logic wikipedia , lookup

First-order logic wikipedia , lookup

Structure (mathematical logic) wikipedia , lookup

Principia Mathematica wikipedia , lookup

Laws of Form wikipedia , lookup

Propositional calculus wikipedia , lookup

Propositional formula wikipedia , lookup

Transcript
Syntax and Semantics for
Propositional and Predicate Logic
compiled by Jonathan Buss, based on material of David Toman
This material forms a summary of the basic notions of propositional and predicate logic, with notation
chosen for the latest version of CS 245. It focuses on definitions and theorems, with little explanation,
to make it most useful as a reference. In some cases, where students in the past have tended to find
the most confusion, a bit of commentary or an exercise appear in an attempt to limit the confusion to
a necessary minimum. Do the exercises; they are perhaps the most important ones you’ll see in the
course.
0
Preliminary Notions
Modern logic is symbolic; that is, it works primarily with symbols. A symbolic logic is also called a
“formal” logic, which means that we concern ourselves primarily with the form of statements. We also
consider the content (or meaning) of statements, but form remains primary.
0.1
Syntax and Semantics
The “syntax” of a language refers to the “form” of the expressions (words, sentences, etc.) The “semantics” of a language refers to the content, or meaning of expressions. Although syntax and symantics
have a close relationship, we shall treat them quite distinctly. The first major contribution of the modern
study of logic is that the study of syntax has enormous benefits even when semantics is unclear. Eventually, and not at all obviously, a deep understanding of formal syntax provided the key to developing
the modern concept of “computer” and the field Computer Science.
0.2
Mathematics About Mathematics
When doing formal logic, we use ordinary mathematical concepts and tools—functions, variables, deductions, etc. This creates a potential confusion: when we mention a mathematical notion, do we mean
that we are using the notion, or that we are talking about it?
For example, consider the variable ’x’. You have often used it, in statements like,“let x be a real
number. . . .” This means that you will use the name ’x’ to refer to some real number; it does not mean
that the symbol ’x’ actually is itself a real number. But suppose you’re not discussing real numbers, but
rather discussing logical statements. Now a “variable” is something that might occur in a statement;
you will need to talk about one. Thus you write, “let x be a variable,” and mean that you will use the
name ’x’ to refer to a variable. But, now, is the name ’x’ itself a variable? It sort-of-is and sort-of-isn’t;
it is the same kind of thing as before, but it refers to a variable rather than being one itself.
Symbols that we use (informally) to discuss (formal) symbols are called “meta-symbols”.
1
1.1
Propositional Logic
Syntax of Propositional Logic
(See Huth and Ryan, §1.3, pp. 31ff.)
1.1 Definition (Symbols and expressions of propositional logic). A expression of propositional
logic consists of a sequence of symbols. We distinguish three kinds of symbols.
Propositional variables. Commonly one uses Latin letters such as p, q, or r. They may have subscripts: p1 , p2 , . . . , q27 ,. . . .
Logical connectives. Normally non-alphabetic symbols: ¬, ∧, ∨, and →.
Punctuation. Normally, only ‘(’ and ‘)’.
The connectives and punctuation have fixed meaning, as determined below. In principle, anything
could be designated a propositional variable, but we shall stick to ones as above, in order to minimize
confusion.
(H&R: Def. 1.2.7, pp. 32–33.)
1.2 Definition (Well-formed formula).
Let P be a set of propositional symbols. We define the set of well-formed formulae over P inductively
as follows. (The term “well-formed formula” is sometimes abbreviated to “WFF”.)
1. An expression consisting of a single propositional symbol is a formula.
2. If α is a formula, then (¬α) is a formula.
3. If α is a formula, β is a formula, then each of (α ∧ β), (α ∨ β) and (α → β) is a formula.
A formula consisting of a variable by itself (Rule 1) is called an atom or an atomic formula.
(Note that the definition uses ‘α’ and ‘β’ as meta-variables; they refer to formulas that may contain
any number of symbols. No formula actually contains the literal symbol ‘α’—it is not a propositional
variable, nor a connective, nor punctuation.)
1.3 Theorem. Every well-formed formula is well-formed in exactly one way. Given the formula, one
can determine unambiguously which rule produces it and what its constituents are.
The definition above requires a pair of parentheses for every connective. For example, it does not
admit the expression
p∧q∧r
as a formula; it requires that one write either
(p ∧ q) ∧ r
or
p ∧ (q ∧ r)
instead. Often, however, we don’t wish to write down so many parentheses. We therefore allow ourselves to write formulas in “relaxed” form, where we omit any parentheses that do not affect the reading
of the formula. Thus we normally write a formula without its outermost pair of parentheses; also, we
omit parentheses that force an application order on an associative operator.
1.4 Exercise.
2
1. Propose a formal definition for the set of “relaxed” formulas. Investigate the effect of your
definition. Does every strict formula correspond to a clear and pleasant relaxed equivalent?
If two or more strict formulas correspond to the same relaxed formula, are they necessarily
equivalent?
2. After doing the previous part, find a friend or classmate who has also done it. Do you have
the same definition? If not, are they equivalent to one another? Can you say that one is better
than the other?
3. Does your set of relaxed formulas satisfy the result of Theorem 1.3?
Substitution: a syntactic operation
Since the set of well-formed formulas has an inductive definition, we can consider manipulating formulas by an inductive process. One such manipulation is called a substitution. For a propositional
variable p and formula γ, we can consider replacing (or substituting) every occurrence of p by γ in
any other formula α. For example, if we replace p by p ∨ q in the formula (q ∧ p) → (p ∨ r), we get
(q ∧ (p ∨ q)) → ((p ∨ q) ∨ r). Formally, we have the following.
1.5 Definition. For a formula α, the substitution of a variable p by a formula γ, denoted α[γ/p],
is given by
• If α is a variable, then
– If α is p, then α[γ/p] is γ.
– If α is some other variable q, then α[γ/p] is α.
• If α is (¬β) for some formula β, then α[γ/p] is (¬β[γ/p]).
• If α is (β ? β) for some connective ?, then α[γ/p] is (β[γ/p] ? β[γ/p]).
Proofs: a syntactic notion
A (formal) proof is a collection of formulas that meets specified requirements. In this course, we use a
set of requirements called Natural Deduction. Its rules are pictured in Figure 1.1 (page 4).
1.6 Definition (Proofs in Natural Deduction).
(H&R: §1.2, pp. 5–27)
Given a set Σ of formulas, the premises, a proof is a sequence (or tree) of formulas and explanations
constructed according to the following rules.
• A premise may be entered at any point, with explanation “premise”.
• Any formula may be entered as the first line of a box, with explanation “assumption”.
• The most recently opened box may be closed at any time.
• A deduction rule may be used as follows: If each formula or box on the top of the rule occurs previously in the proof but not inside a closed box, then you may enter as the next line
the formula at the bottom of the deduction rule, with the rule name and line numbers as
explanation.
3
In each use of a rule, you must choose the same formula both on the top and bottom of the
rule. However, you may make different choices each time you use a rule.
• All boxes must be closed before the end of the proof.
The last formula in the proof is called the conclusion. A proof with premises Σ and conclusion α is
called a proof of α from Σ. The notation Σ ` α means that there is a proof of α from Σ.
Note that the rules are purely syntactic. A proof is a proof by virtue of the relationships among its
constituent formulas. The “meaning” of the formulas has no relevance whatsoever.
Some people like to think of proofs as a kind of game. The legal moves of the game are given by
the rules. The formula to be proven is the goal; to win the game is to reach the goal using only legal
moves.
Figure 1: Rules for Natural Deduction in Propositional Logic
Connective
Introduction Rule(s)
α
∧
β
α∧β
∨
α
α∨β
α∧β
∧i
α
∨i1
β ∨α
Elimination Rule(s)
α∧β
∧e1
α
β
α.
..
γ
∨i2
α∨β
β
..
.
γ
∨e
γ
→
α→β
¬
α
α.
..
β
¬α
α→β
→e
β
→i
α
α.
..
⊥
¬α
⊥
¬e
¬i
⊥
(same as ¬e)
⊥
⊥e
α
¬¬
(derived)
¬¬α
¬¬e
α
4
∧e2
1.2
Semantics of propositional logic
We derive the meaning of a formula from its structure as a formula; that is, according to the reason that
it is well-formed. Definition 1.2 ensures that this process gives every well-formed formula a meaning,
while Theorem 1.3 guarantees that no formula gets two or more different meanings. To start the process,
we assign values to the atoms. Let P be the set of propositional symbols.
1.7 Definition (Valuations; values).
(H&R: Def. 1.28 et seq., pp. 37–40.)
A valuation is a function v : P → {F, T} that assigns either true (T) or false (F) to every propositional
variable in P.
Each valuation v gives a value, denoted α v , to each formula α, as follows.
• If α is an atom p, then the value of α is v(p).
¨
T if β v = F
• If α is (¬β), then the value of α is
F if β v = T.
¨
• If α is (β1 ∧ β2 ), then the value of α is
¨
• If α is (β1 ∨ β2 ), then the value of α is
T if β1v = T and β2v = T
F if β1v = F or β2v = F.
T if β1v = T or β2v = T
F if β1v = F and β2v = F.
¨
• If α is (β1 → β2 ), then the value of α is
T if βTv = F or β2v = T
F if β1v = T and β2v = F.
The following “truth table” summarizes the above.
β1
β2
¬β1
β1 ∧ β2
β1 ∨ β 2
β1 → β2
T
T
F
F
T
F
T
F
F
F
T
T
T
F
F
F
T
T
T
F
T
F
T
T
1.8 Definition (satisfiability). If a valuation t assigns T to a formula α, then t satisfies α, sometimes denoted t |= α. If t assigns T to every formula α in a set Σ, then t satisfies Σ.
A well-formed formula α is
• valid (or, a tautology) if every valuation satisfies α,
• satisfiable if some valuation satisfies α, and
• unsatisfiable (or, a contradiction) if no valuation satisfies α.
A set Σ of well-formed formulae is satisfiable if there is a valuation t that satisfies every α ∈ Σ;
otherwise Σ is unsatisfiable.
1.9 Definition (equivalence). Two well-formed formulae α and β are equivalent if and only if
5
• every valuation that satisfies α also satisfies β, and
• every valuation that satisfies β also satisfies α.
The notation α ≡ β denotes that α and β are equivalent.
(H&R: Def. 1.34, p. 46.)
1.10 Definition (entailment).
A formula α logically implies, or entails, a formula β, denoted α |= β, if and only if every valuation
that satisfies α also satisfies β.
A set Σ of formulas entails formula β, denoted Σ |= β, if and only if every valuation that satisfies
every formula in Σ also satisfies β.
If the empty set entails β (i.e., if β is a tautology), then we write simply |= β.
(H&R: Exercise 1.5.3, p. 87)
1.11 Definition (adequate sets).
A set of propositional connectives S is adequate if for an arbitrary k-ary Boolean function f there is a
well-formed formula α f that uses only logical connectives in S and propositional symbols p1 , . . . , pk ,
such that for every valuation t,
α tf = f (t(p1 ), . . . , t(pk )) .
1.12 Theorem. Each of the sets {∧, ¬}, {∨, ¬}, and {→, ¬} is an adequate set of propositional connectives.
1.3
Entailment and Proof
1.13 Definition (soundness and completeness). A proof system is sound if for every proof, the
premises entail the conclusion; that is, for every set Σ and formula α,
if Σ ` α then Σ |= α .
A proof system is complete if every instance of entailment has a corresponding proof; that is, for
every set Σ and every formula α,
if Σ |= α then Σ ` α .
(H&R: §§1.4.3 and 1.4.4, pp. 45–53.)
1.14 Theorem.
Natural Deduction is sound and complete for propositional logic.
1.15 Corollary (compactness). A set Σ is satisfiable if and only if for every finite Σ0 ⊆ Σ, the set
Σ0 is satisfiable.
Proof. By Theorem 1.14, Σ is unsatisfiable if and only if Σ is inconsistent; that is, there is a formula β
for which both Σ ` β and Σ ` ¬β. Both of those proofs are finite. Thus the set Σ0 of premises
actually used in either of these proofs is an inconsistent finite subset of Σ. By Theorem 1.14 again, Σ0
is unsatisfiable, as claimed.
ƒ
6
2
Predicate Logic
Predicate logic adds to propositional logic the ability to refer to objects and their properties. In particular,
we use variables to refer to a particular object, without specifying exactly which one. Mostly, variables
are used the same way you have used them for many years, but some details normally get glossed over.
The sidebar on page 9 gives a brief reminder of some subtleties.
2.1
Syntax of predicate logic
Compared to propositional logic, predicate logic has additional symbols to refer to the additional concepts. Also, the syntax makes use of terms—expressions that are not full formulas but only constituents
of formulas.
Symbols
Predicate logic has seven kinds of symbols, as follows.
• Constant (or individual) symbols: a, b, etc.
• Function symbols: f , g, etc. Each has an associated arity (number of arguments); to denote that
f has arity k, we write f (k) . (Arity 0 is allowed; a function symbol of arity 0 is a constant.)
• Relation symbols: A, R, etc. Each has an associated arity; to denote that R has arity k, we write R(k) .
A relation symbol of arity 0 is essentially a propositional variable.
• Variables: u, x, y, etc.
• Propositional connectives: {∧, ∨, ¬, →}.
• Quantifiers: ∃ and ∀.
• Punctuation: ’(’, ’)’ and ’,’.
The set of symbols of the first three kinds—constants, functions and relations—comprise the vocabulary.
The vocabulary in use may change from time to time.
One may also specify non-alphabetic symbols for the vocabulary, e.g., 0, +, <, etc. Note, however,
that they do not carry any pre-defined meaning.
Terms
Intuitively, a term refers to an object in the domain. From the syntactic point of view, however, we
define terms simply as expressions, without regard to any domain.
(H&R: Def. 2.1, p. 99)
2.1 Definition (term).
1. Every constant symbol and every variable is a term. (These are called atoms, or atomic terms).
2. If f is a function symbol of arity k and t 1 , t 2 , . . . , t k are terms, then f (t 1 , t 2 , . . . , t k ) is a term.
In the case k = 2, a binary function, we also allow (t 1 f t 2 ) as a term.
7
Formulas
We use terms to construct formulas.
(H&R: Def. 2.3, p. 100)
2.2 Definition (formula).
An expression is a formula (of predicate logic) if it can be constructed by the following rules.
1. If R is a relation symbol of arity k and t 1 , t 2 , . . . , t k are terms, then R(t 1 , t 2 , . . . , t k ) is a formula.
If the arity is 2, we also allow (t 1 R t 2 ) as a formula.
(Such a formula is an atomic formula, or atom.)
2. If α and β are formulas, then so are (¬α) and (α ? β), where ? ∈ {∧, ∨, →, ↔}.
3. If α is a formula and x a variables, then (∀x α) and (∃x α) are formulas.
As with propositional formulas, we may sometimes omit to write down parentheses, if it’s clear where
they should go. Nevertheless, a truly well-formed formula has all of the required parentheses.
Free and bound variables
(H&R: Def. 2.6, p. 103)
2.3 Definition.
Each occurrence of a variable in a formula is either free or bound, determined as follows.
• Every occurrence in an atomic formula is free.
• If α is ¬β1 or β1 ? β2 , then each occurrence in α has the same status (free or bound) in α as
the corresponding occurrence in β1 or β2 .
• If α is ∃x β or ∀x β, then
– Any occurrence of x in β is bound in α.
– An occurrence of any other variable has the same status in α as in β.
2.4 Exercise. Convince yourself that the definition above actually says the same thing as the one
in the textbook.
Substitution
Substitution is a key concept in predicate logic, especially the substitution of an arbitrary term for a
variable. (We can still substitute formulas for propositional variables, as before, but that turns out
much less interesting.) For this section, we give the syntactic definition of substitution. It includes a
sharp distinction between free and bound variables. Although we make this distinction for semantic
reasons, the substitution itself is purely syntactic. One (or a computer) can perform a substitution
without understanding any “meaning” for it.
We begin with terms.
(H&R: part of Def. 2.7, p. 105)
2.5 Definition (substitution in terms).
If t is a term, v is a variable, and s is a term, then t[s/v], “t with s substituted for v,” is as follows.
8
course). Similarly, we can replace n by, say, m2 and get
Variables
In ordinary mathematics, one uses variables in several
ways.
m2
X
• A (temporary) name for a specific object. E.g.,
“let x be the number 7. Then x 2 + 1 = 50.”
i=0
• A representative of a class of objects. E.g., “For
every natural number n, . . . .”
n
X
One of the difficulties in learning to read mathematics
is to separate which usage is current at a given time.
In formalizing mathematics, for example by predicate
logic, we have to specify usages exactly. A key concept
is the distinction between “free” and “bound” variables.
Roughly, a free variable is one whose value is not constrained, except that the value must lie in a specific set
(the “domain” of the variable). A bound variable has a
meaning determined by the context in which it occurs.
For example, consider the equation
xi =
i=0
x n+1 − 1
.
x −1
j=0
i=0
yi =
y
xj =
x n+1 − 1
.
x −1
This statement has exactly the same meaning as the
original: it specifies the same property of the numbers
n and x. Changing the name of a bound variable has
no effect.
On the other hand, if we try to substitute m2 for i, we
get
n
X
2
x n+1 − 1
xm =
.
x −1
m2 =0
(1)
This isn’t actually an equation,
since it’s not wellP
formed. The subscript on
must use a variable, not
a longer formula.
In summary, a free variable refers to an object external
to the formula. A bound variable refers to something inside the formula, but has no effect externally. In formal
logic, we make the distinction carefully, in the syntax of
formulas, in order to yield precise semantics for formulas.
In this equation, x and n are free variables; they can
have any value (except that the right-hand side is undefined for x = 1). The variable i, however,
P is bound.
Its meaning is fixed by the definition of the
notation.
To use i outside of the sum—say on the right-hand side
of the equation—would have no meaning.
One difference between free and bound variables appears when we consider changing them. Suppose we
substitute y for x in equation (1), yielding
n
X
2
This again makes a different (true) statement than the
original.
Suppose, however, that we substitute j for the bound
variable i in equation (1):
• A value that changes over time. E.g., “the position of the car at time t is f (t).”
n
X
x m +1 − 1
x =
.
x −1
i
2.6 Exercise. Let j = 4 and n = 3. What is the
value of
n+1
−1
.
y −1
j+
n
X
j ?
j=1
If x and y refer to different values, then the two equations state different things (although both are true, of
Is it (a) 14 (b) 16 (c) another value (d) undefined ?
1. If t is simply the variable v, then t[s/v] is s.
If t is some other variable or is a constant, then t[s/v] is t.
2. If t is f (t 1 , t 2 , . . . , t k ), then t[s/v] is f t 1 [s/v], t 2 [s/v], . . . , t k [s/v] .
If the substituted term s is a single variable or constant, then t[s/v] has the same parse tree as t—except
that some leaf nodes have their label changed from v to s. (Unless s is v, and the terms are identical.)
For a larger term s, the parse tree of t[s/v] grows, relative to the original.
Substitutions into formulas work much the same way, except for a twist regarding quantifiers.
9
(H&R: Def. 2.7, p. 105)
2.7 Definition (substitution in formulas).
For a formula α, the substitution of a variable x by a term t, denoted α[t/x], is given by
• If α is R(t 1 , . . . , t k ) for some relation symbol R, then α[u/x] is R(t 1 [u/x], . . . , t k [u/x]).
• If α is ¬β or β ? β for some connective ?, then α[u/x] is ¬β[u/x] or β[u/x] ? β[u/x],
respectively.
• If α is Q y β (for Q∈{∀, ∃}) for some variable y, we consider three cases.
– If x is the same variable as y, then α[t/x] is α. (No substitution for a bound variable.)
– If the variable y does not occur in the term t, then α[t/x] is Q y β[t/x].
– If y occurs in t, let z be a variable that has no free occurrence in either β or t. Then
α[t/x] is Qz β[z/ y][t/z].
Some authors, including the textbooks’, prefer to avoid the final case (choice of a new variable), and
say that the substitution “α[u/x]” is undefined whenever some variable that occurs bound in α also
occurs (free) in u. This has the advantage of avoiding the complication, but the disadvantage that every
use of substitution requires a “side condition” that the substitution is defined. We shall normally choose
examples such that the difference does not arise—except when we want to emphasize the need for care
in manipulating formulas.
Proofs in predicate logic
The proof rules for predicate logic include all of the ones for propositional logic (see Figure 1.1), extended to formulas of predicate logic. Additional rules deal with formulas that contain quantifiers. In
the following table, α is any formula, x and x 0 are each any variable, and t is any term.
Quantifier
∀
Introduction Rule
∀x α
x 0 fresh
..
.
α[x 0 /x]
∀x α
∃
Elimination Rule
α[t/x]
∃x α
α[t/x]
∀e
∀i
∃i
∃x α
α[x 0 /x], x 0 fresh
..
.
β
β
∃e
The term “fresh” means that the variable has no free occurence anywhere in the proof except in the box
that introduces it. For example, in rule ∃e, formula β must not contain x 0 , since it travels outside of the
box. Indicate the freshness when annotating a use of the rule. (In rules ∀iand ∃e, it is permissible to
have x and x 0 the same variable. Since the occurrences of x outside the box are bound by the quantifier,
x can be fresh.)
10
2.2
Semantics of predicate logic
Predicate logic has a much richer semantics than propositional logic. We can no longer get by with
simple valuations. Instead, we consider a semantic interpretation in two parts, an interpretation and an
environment.1
Interpretations and Models
(H&R: Def. 2.14, p. 124)
2.8 Definition (interpretation).
Fix a set of constant symbols, function symbols and relation symbols, together with their arities. An
interpretation I consists of the following.
• A non-empty set A, called the domain or the universe.
• For each constant symbol c, a member c I of A.
• For each function symbol f of arity k, a function f I : Ak 7→ A.
• For each relation symbol R of arity k, a relation RI ⊆ Ak .
Although an interpretation is only half of the semantics, we can still give a few examples.
2.9 Example. Fix a vocabulary V with one constant symbol 1, one function symbol f (1) , and one
relation symbol <(2) . We consider a few interpretations for V .
1. Let Z have domain Z, the set of integers, let 1Z be the number one, let f Z be the squaring
function, and let <Z be the usual less-than relation. Then Z is an interpretation for V .
2. Let Y have domain Q, the set of rational numbers, let 1Y be the number one, let f Y be the
halving function (taking x to x/2), and let <Y be the greater-than relation. Then Y is an
interpretation for V .
3. Let X have domain the set of all people, let 1X be Justin Trudeau, let f X be the function
mapping each person to their mother, and let <X be the older-than relation. Then X is an
interpretation for V .
These three interpretations give very different meanings to a formula. For example, the formula
1 < x → x < f (x)
means
• under interpretation Z : an integer greater than one is less than its square (always true);
• under interpretation Y : a rational number less than one is greater than half of itself (sometimes true, sometimes false);
• under interpretation X : a person younger than Justin Trudeau is older than their mother
(always false).
To fully explain these examples, we need to give a semantics to variables.
1
Some authors, including Huth and Ryan, use the term “model” in place of “interpretation”. This can get very confusing,
since other authors use the term “model” to mean a “satisfying interpretation” (see (Def. 2.12). An environment is sometimes
called an “assignment” or a “look-up table” (as in Huth and Ryan).
11
Environments
(H&R: Def. 2.17, p. 127)
2.10 Definition (environment).
For a set A, considered as the domain of an interpretation, an environment is a function E that assigns
a member of A to each variable symbol.
For an environment E, variable x and element a ∈ A, we denote by E[x 7→ a] the environment
defined by
¨
a
if y = x
E[x 7→ a]( y) =
E( y) otherwise
(H&R: first part of Def. 2.18, p. 128)
2.11 Definition (value of a term).
Let I be an interpretation with domain A, and let E be an environment for A. Each term t has a
value under E, denoted t (M,E) , as follows.
• If t is a variable x, then t (M,E) is E(x).
(M,E)
• If t is a function application f (t 1 , . . . , t k ), then t (M,E) is f M (t 1
(M,E)
, . . . , tk
).
Satisfaction, etc.
2.12 Definition (satisfaction of formulas).
(H&R: Def. 2.18, p. 128)
Fix any pair (I , E) of an interpretation and an environment. For each formula α, either (I , E)
satisfies α, denoted M |= E α, or (I , E) does not satisfy α, denoted M 6|= E α, determined by induction
on the structure of α.
¶
¬
(M,E)
(M,E)
∈ RM .
, . . . , tk
• If α is an atom R(t 1 , . . . , t k ), then M |= E α if and only if t 1
• If α is one of ¬β, β ∧ γ, β ∨ γ, or β → γ, then satisfaction follows the rules for truth in
propositional logic (see the table below).
• If α is ∀x β, then M |= E α if and only if for every a ∈ A, M |= E[x7→a] β.
• If α is ∃x β, then M |= E α if and only if there is some a ∈ A such that M |= E[x7→a] β.
In tabular form:
Form of α
R(t 1 , . . . , t k )
¬β
β ∧γ
β ∨γ
β →γ
∀x β
∃x β
Condition for M |= E α
t
E 1 , . . . , E t k ∈ RM
M 6|= E β
both M |= E β and M |= E β
either M |= E β or M |= E γ (or both)
either M 6|= E β or M |= E γ (or both)
for every a ∈ A, M |= E(x7→a) β
there is some a ∈ A such that M |= E(x7→a) β
In the case that M |= E α for every environment E, then I satisfies α, denoted I |= α.
Validity and satisfiability have definitions analogous to the ones for propositional logic.
12
(H&R: Def. 2.20, p. 129.)
2.13 Definition (satisfiability).
A well-formed formula α is
• valid if every interpretation and environment satisfy α; that is, if M |= E α for every I and E
(the term “tautology” is not used in predicate logic),
• satisfiable if some interpretation and environment satisfy α; that is, if M |= E α for every I
and E, and
• unsatisfiable if no interpretation and environment satisfy α; that is, if M 6|= E α for every I
and E.
For example, the formula 1 < x → x < f (x) considered above is satisfiable but not valid.
(H&R: Def. 2.20, p. 129.)
2.14 Definition (entailment).
A formula α logically implies, or entails, a formula β, denoted α |= β, if and only if every model and
environment that satisfy α also satisfy β.
A set Σ of formulas entails formula β, denoted Σ |= β, if and only if every interpretation and
environment that satisfy every formula in Σ also satisfy β.
If the empty set entails β, then we write simply |= β.
2.3
Entailment and Proof
The definitions and theorems for predicate logic look exactly the same as the corresponding ones for
propositional logic. (The proof of completeness is rather more complicated, however.)
2.15 Definition (soundness and completeness). A proof system is sound if for every proof, the
premises entail the conclusion; that is, for every set Σ and formula α
if Σ ` α then Σ |= α .
A proof system is complete if every instance of entailment has a corresponding proof; that is, for
every set Σ and every formula α,
if Σ |= α then Σ ` α .
2.16 Theorem. Natural Deduction is sound and complete for predicate logic.
A key element of the proof of completeness uses the notion of consistency.
2.17 Definition (consistency). A set Σ of formulas is consistent if and only if there is no formula α
such that both Σ ` α and Σ ` ¬α.
(Note that consistency is a purely syntactic notion; “meaning” doesn’t enter into it.)
2.18 Lemma. For every consistent set Σ of formulas, there is a set Σ0 containing Σ that is maximally
consistent; that is, Σ0 is consistent and for every formula α,
α 6∈ Σ0 if and only if Σ0 ∪ α is inconsistent.
13
2.19 Corollary (compactness). A set Σ is satisfiable if and only if for every finite Σ0 ⊆ Σ, the set
Σ0 is satisfiable.
Proof. By Theorem 2.16, Σ is unsatisfiable if and only if Σ is inconsistent; that is, there is a formula β
for which both Σ ` β and Σ ` ¬β. Both of those proofs are finite. Thus the set Σ0 of premises
actually used in either of these proofs is an inconsistent finite subset of Σ. By Theorem 2.16 again, Σ0
is unsatisfiable, as claimed.
ƒ
2.4
Predicate Logic with Equality
Most relation symbols carry no special meaning in predicate logic—an interpretation can assign any
relation at all (of the appropriate arity). However, it sometimes pays to make one exception, for the
equality relation. In “Predicate Logic with Equality,” the symbol ‘=’ is reserved as a symbol denoting the
relation
{ 〈x, x〉 | x ∈ D }
where D is the domain. In this case, we can add introduction and elimination rules for this symbol.
Introduction Rule
=
t=t
Elimination Rule
=i
t1 = t2
α[t 1 /x]
α[t 2 /x]
=e
The blank hypothesis in the introduction rule means that no condition is required for the conclusion.
Such a rule is called an axiom.
All of the theorems in the previous section hold in predicate logic with equality.
14