0% found this document useful (0 votes)
16 views

Predicate

Uploaded by

Karus Insania
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Predicate

Uploaded by

Karus Insania
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 120

First-Order Predicate Logic

First-Order Logic 145/448


What Propositional Logic Cannot Express

Propositional logic dealt with logical forms of compound propositions. It


worked well with relationships like not, and, or, if/then.

We would like to have a way to talk about individuals (also called


objects) and in addition to talk about some object, and all objects,
without enumerating all objects in a set.

This requires extensions to Propositional Logic.

First-Order Logic Introduction and Motivation 146/448


Some Example Statements

Some example statements:

Not all birds can fly.

Every student is younger than some instructor.

These refer to things: birds, students, instructors. They also refer to


properties of things, either as individuals (ability to fly) or in
combination (relative age).
We would like to make such statements in our logic and to combine
them with the connectives of propositional logic.

First-Order Logic Introduction and Motivation 147/448


Further Example Statements

More examples:

• For any natural number n, there is a prime number greater than n.


• 2100 is a natural number.
• There is a prime number greater than 2100 .
• There is a number c such that for every input of n characters, the
program executes at most c · n2 operations.

First-Order Logic (FOL), also called Predicate Logic, gives us a language


to express statements about objects and their properties.

First-Order Logic Introduction and Motivation 148/448


Ingredients of FOL

FOL is expressed with the following ingredients:

• A domain of objects (individuals)


(e.g., the set of natural numbers, people)
• Names of individuals (e.g., ‘0’, Prime Minister)
(Also called “constants”)
• Variables (denoting “generic” objects)
• Relations (e.g., equal, younger-than, etc.)
• Functions (e.g., ‘+’, mother-of)
• Quantifiers
• Propositional connectives

We shall discuss each informally, and later treat syntax and semantics
formally.

First-Order Logic Introduction and Motivation 149/448


Domains

A domain is a set of objects. In principle, any non-empty set can be a


domain: the natural numbers, people now alive, {T, F}, etc.

Normally, one or more objects in the domain will have a name; e.g., 0,
Stephen Harper, T, etc. Such names are called constant symbols.

First-Order Logic Concepts of First-Order Logic 150/448


Predicates/Relations

A predicate, or relation, represents a property that an individual, or


collection of individuals, may (or may not) have. In English, we might
express a predicate as

“ is a student”.

In symbolic logic, we write “ S(x)” to mean “ x has property S ”.


For example, if S is the property of being a student, then “Alex is a
student” becomes “ S(Alex)”.
Similarly, we might use I(Sam) for “Sam is an instructor”
and Y (Alex,Sam) for “Alex is younger than Sam”.

First-Order Logic Concepts of First-Order Logic 151/448


Representing Relations

Mathematically, we represent a relation by the set of all things that have


the property. If S is the set of all students, then x ∈ S means x is a
student. The only restriction on a relation is that it must be a subset of
the domain.
A k-ary relation is a set of k-tuples of domain elements. For example,
the binary relation less-than, over a domain D, is represented by the set

〈x, y〉 ∈ D2 | x < y

.

(In a “relational database”, the listing of such a set is called a “table”.)

First-Order Logic Concepts of First-Order Logic 152/448


Variables

Variables make statements more expressive.


You may think of a variable as a “place holder”, or “blank”, that can be
replaced by a concrete object.
Alternatively, a variable is a name without a fixed referent. Which object
the name refers to can vary from time to time.

A variable lets us refer to an object, without specifying—perhaps


without even knowing—which particular object it is. Thus we can
express a relation “in the abstract”.

S(x): x is a student
I(x): x is an instructor
Y (x, y): x is younger than y

First-Order Logic Concepts of First-Order Logic 153/448


Uses of Variables

In general, we use variables that range over the domain to make general
statements, such as
x2 ≥ 0 ,
and in expressing conditions which individuals may or may not satisfy,
such as
x+x=x∗x .
This latter condition is satisfied by only two numbers: 0 and 2.

The meaning of such an expression will depend on the domain. For


example, the formula x 2 < x is always false over the domain of integers,
but not over the domain of rational numbers.

First-Order Logic Concepts of First-Order Logic 154/448


Quantifiers

How to handle “Every student x is younger than some professor y ”?


In math-speak, we say “for all” to express “every” and “there exists” to
express “some.” A familiar(?) example from calculus:

For all " > 0, there exists δ > 0 such that for all y ,
if |x − y| < δ then | f (x) − f ( y)| < " .

“For all” is denoted by ‘∀’, the universal quantifier symbol, and


“there exists” is denoted by ‘∃’, the existential quantifier symbol.
In FOL, the above comes out as the formula
€ Š
∀" · " > 0 → ∃δ · δ > 0 ∧ ∀ y ·(|x − y| < δ → | f (x) − f ( y)| < ") .

First-Order Logic Concepts of First-Order Logic 155/448


Quantifiers: Examples

Quantifiers require a variable: ∀x (for all x ) or ∃z (there exists z ).

For example, the statement “Not all birds can fly” can be written as

¬(∀x ·(B(x) → F (x))) .

“Every student is younger than some instructor” can become

∀x ·(S(x) → (∃ y ·(I( y) ∧ Y (x, y)))) .

Or should that be ∃ y ·(I( y) ∧ ∀x ·(S(x) → Y (x, y)))?

First-Order Logic Concepts of First-Order Logic 156/448


Functions

In addition to predicates and quantifiers, first-order logic extends


propositional logic by using functions as well. To see why, consider the
following statement.

Every child is younger than its mother.

One might try to express this statement in FOL by the formula

∀x · ∀ y · ((C(x) ∧ M ( y, x)) → Y (x, y)) .

But this allows x to have several mothers!

First-Order Logic Concepts of First-Order Logic 157/448


Functions: Example and Definition

Functions in FOL give us a way to express statements more concisely.


The previous example can be expressed as

∀x · C(x) → Y (x, m(x))

where m denotes the function that takes one argument and returns the
mother of that argument.

Formally, we represent a k-ary function f as the k + 1-ary relation R f


given by

R f = 〈x 1 , . . . , x k , x k+1 〉 ∈ D k+1 | f (x 1 , . . . , x k ) = x k+1 .

First-Order Logic Concepts of First-Order Logic 158/448


Functions: Further Examples

More examples:

• Alex and Sam have the same maternal grandmother:

m(m(a)) = m(m(s)) .

• Some program computes the squaring function:

∃p · ∀x · r(p, x) = x ∗ x .

These use m(·) as “mother-of” and r(·, ·) as “result-of”.

First-Order Logic Concepts of First-Order Logic 159/448


Syntax of Predicate Logic

Syntax of First-Order Logic 160/448


The Language of First-Order Logic

The seven kinds of symbols:


1. Constant symbols. Usually c, d, c1 , c2 , . . . , d1 , d2 . . .
2. Variables. Usually x, y, z, . . . x 1 , x 2 , . . . , y1 , y2 . . .
3. Function symbols. Usually f , g, h, . . . f1 , f2 , . . . , g1 , g2 , . . .
4. Predicate symbols. P , Q, . . . P1 , P2 , . . . , Q 1 , Q 2 , . . .
5. Connectives: ¬, ∧, ∨, →
6. Quantifiers: ∀ and ∃
7. Punctuation: ‘(’, ‘)’, ‘·’, and ‘,’
The last three kinds of symbols—connectives, quantifiers, and
punctuation—will have their meaning fixed by the syntax and semantics.
The first four kinds—constants, variables, functions, and predicates—are
not restricted. They may be assigned any meaning, consistent with their
kind and arity.

Syntax of First-Order Logic 161/448


Terms

In FOL, we need to consider two kinds of expressions:

• those that can have a truth value, called formulas, and


• those that refer to an object of the domain, called terms.

We start with terms.


Definition. The set of terms is defined inductively as follows.

1. Each constant symbol is a term, and each variable is a term.


Such terms are called atomic terms.
2. If t 1 , . . . , t n are terms and f is an n-ary function symbol,
then f (t 1 , . . . , t n ) is a term. If n = 2 (a binary function symbol), we
may write (t 1 f t 2 ) instead of f (t 1 , t 2 ).
3. Nothing else is a term.

Syntax of First-Order Logic 162/448


Examples of Terms

Example 1. If 0 is a constant symbol, x and y are variables, and s(1) and


+(2) are function
 symbols, then 0, x , and y are terms, as are s(0) and
+ x, s( y) .

The expressions s(x, y) and s + x are not terms.

Example 2. Suppose f is a unary function symbol, g is a binary function


symbol, and a is a constant symbol.
€ Š
Then g( f (a), a) and f g a, f (a) are terms.

The expressions g(a) and f f (a), a are not terms.

Syntax of First-Order Logic 163/448


Atomic Formulas

As in propositional logic, a formula represents a proposition (a true/false


statement). The relation symbols produce propositions.

Definition: An atomic formula (or atom) is an expression of the form

P(t 1 , . . . , t n )

where P is an n-ary relation symbol and each t i is a term (1 ≤ i ≤ n).


If P has arity 2, the atom P(t 1 , t 2 ) may alternatively be written (t 1 P t 2 ).

Syntax of First-Order Logic 164/448


General Formulas

We define the set of formulas of first-order logic inductively as follows.

1. An atomic formula is a formula.


2. If α is a formula, then (¬α) is a formula.
3. If α and β are formulas, and ? is a binary connective symbol,
then (α ? β) is a formula.
4. If α is a formula and x is a variable,
then each of (∀x · α) and (∃x · α) is a formula.
5. Nothing else is a formula.

In case 4, the formula α is called the scope of the quantifier. The


quantifier keeps the same scope if it is included in a larger formula.

Syntax of First-Order Logic 165/448


Parse Trees

Parse trees for FOL formulas are similar to parse trees for propositional
formulas.

• Quantifiers ∀x and ∃ y form nodes is the same way as negation (i.e.,


only one sub-tree).
• A predicate P(t 1 , t 2 , . . . , t n ) has a node labelled P with a sub-tree for
each of the terms t 1 , t 2 , . . . , t n .

Syntax of First-Order Logic 166/448


Examples: Parse trees

Example: (∀x ·((P(x) → Q(x)) ∧ S(x, y))).

Syntax of First-Order Logic 167/448


Examples: Parse trees

Example: (∀x ·((P(x) → Q(x)) ∧ S(x, y))).

Example: (∀x ·(F (b) → (∃ y ·(∀z ·(G( y, z) ∨ H(u, x, y))))))

Syntax of First-Order Logic 167/448


Examples: Parse trees

Example: (∀x ·((P(x) → Q(x)) ∧ S(x, y))).

Example: (∀x ·(F (b) → (∃ y ·(∀z ·(G( y, z) ∨ H(u, x, y))))))

Ordinarily, one would omit many of the parentheses in the second


formula, and write simply
€ Š
∀x · F (b) → ∃ y · ∀z · G( y, z) ∨ H(u, x, y) .

Syntax of First-Order Logic 167/448


Semantics: Interpretations

We shall cover more about syntax later, but we first start the discussion
of semantics.

Definition: Fix a set L of constant symbols, function symbols, and


relation symbols.
An interpretation M (for the set L) consists of

• A non-empty set dom(M), called the domain (or universe) of M.


• For each constant symbol c , a member c M of dom(M).
• For each function symbol f (i) , an i -ary function f M .
• For each relation symbol R(i) , an i -ary relation RM .

An interpretation is also called a model.

Variable-free semantics 168/448


Values of Variable-Free Terms

For terms and formulas that contain no variables or quantifiers, an


interpretation suffices to specify their meaning. The meaning arises in
the obvious(?) fashion from the syntax of the term or formula.

Definition: Fix an interpretation M. For each term t containing no


variables, the value of t under interpretation M, denoted t M , is as
follows.

• If t is a constant c , the value t M is c M .


• If t is f (t 1 , . . . , t n ), the value t M is f M (t 1M , . . . , t nM ).

The value of a term is always a member of the domain of M.

Variable-free semantics 169/448


Formulas with Variable-Free Terms

Formulas get values in much the same fashion as terms,


except that values of formulas lie in {F, T}.

Definition: Fix an interpretation M. For each formula α containing no


variables, the value of α under interpretation M, denoted αM , is as
follows.

• If α is R(t 1 , . . . , t n ), then
(
T if 〈t 1M , . . . , t nM 〉 ∈ RM
αM =
F otherwise.

• If α is (¬β) or (β ? γ), then αM is determined by β M and γM in the


same way as for propositional logic.

Variable-free semantics 170/448


Examples
Let 0 be a constant symbol, f€(1) a function symbol and E (1) a relation
 Š
symbol. Thus E f (0) and E f f (0) are both formulas.
Consider an interpretation M with

Domain: N, the natural numbers


0M : zero 
f M: successor; 〈x, x + 1〉 | x ∈ N
EM: “is even”; 2 y | y ∈ N
M
Terms get numerical values: f (0)M is 1 and f f (0) is 2.
 M
Formula E f (0) means “1 is even”, and E f (0) = F.
€ Š €  ŠM
Formula E f f (0) means “2 is even”, and E f f (0) = T.

What about some other interpretation?


Variable-free semantics 171/448
Example, Continued

Let N be the interpretation with

Domain: Q, the rational numbers


0N : two ¦ ©
f N: halving; x, x/2 | x ∈ Q

EN : “is an integer”; x | x ∈ Z

 N
E f (0) means “1 is an integer”, and E f (0) is T.
€ Š €  ŠN
E f f (0) means “1/2 is an integer”, and E f f (0) is F.

€ Š 
Exercise: in both M and N , the formula E f f (0) ∧ E f (0) receives
value F. Find another interpretation which gives it the value T.

Variable-free semantics 172/448


“Gotchas”

Two often-overlooked points about interpretations.

1. There is NO default meaning for relation, function or constant


symbols.

“ 1 + 2 = 3” might mean that one plus two equals three—but only if


we specify that interpretation. Any interpretation of constants 1, 2,
and 3, function symbol +(2) and relation symbol =(2) is possible.

2. Functions must be defined at every point in the domain.


(I.e., they must be total.)

If we have language with a binary function symbol “ −”, we cannot


specify an interpretation with domain N and subtraction for “ −”.
Subtraction is not total on N.

Variable-free semantics 173/448


Variables

To discuss the evaluation of formulas that contain variables, we need a


few more concepts from syntax.
We shall discuss

• “bound” and “free” variables,


• substitution of terms for variables.

Syntax, Continued Free and Bound Variables 174/448


Free and Bound Variables

Recall: the scope of a quantifier in a sub-formula ∀x · α or ∃x · α is the


formula α.
An occurrence of a variable in a formula is bound if it lies in the scope of
some quantifier of the same variable; otherwise it is free. In other words,
a quantifier binds its variable within its scope.

Example. In formula ∀x · ∃ y ·(x + y = z), x is bound (by ∀x ), y is bound


(by ∃ y ), and z is free.

Example. In formula P(x) ∧ ∀x · ¬Q(x), the first occurrence of x is free


and the last occurrence of x is bound.

(The variable symbol immediately after ∃ or ∀ is neither free nor bound.)

Syntax, Continued Free and Bound Variables 175/448


Free and Bound Variables

Formally, a variable occurs free in a formula α if and only if it is a


member of the set FV(α) defined as follows.

1. If α is P(t 1 , . . . , t k ), then FV(α) = x | x appears in some t i .
2. If α is (¬β), then FV(α) = FV(β)
3. If α is (β ? γ), then FV(α) = FV(β) ∪ FV(γ).
4. If α is Q x · β (for Q ∈ {∀, ∃}), then FV(α) = FV(β) − {x}

A formula has the same free variables as its parts, except that a
quantified variable becomes bound.

Syntax, Continued Free and Bound Variables 176/448


Substitution
The notation α[t/x], for a variable x , a term t , and a formula α,
denotes the formula obtained from α by replacing each free occurrence
of x with t . Intuitively, it is the formula that answers the question,

“What happens to α if x has the value specified by term t ?”

Examples.
 
• If α is the formula E f (x) , then α[ y + y/x] is E f ( y + y) .
€ Š
• α[ f (x)/x] is E f f (x) .
 
• E f (x + y) [ y/x] is E f ( y + y) .

Substitution does NOT affect bound occurrences of the variable.



• If β is ∀x · E( f (x)) ∧ S(x, y) , then β[g(x, y)/x] is β ,
because β has no free occurrence of x .
Syntax, Continued Substitution 177/448
Examples: Substitution

Example. Let β be P(x) ∧ ∃x · Q(x). What is β[ y/x]?

Syntax, Continued Substitution 178/448


Examples: Substitution

Example. Let β be P(x) ∧ ∃x · Q(x). What is β[ y/x]?


β[ y/x] is P( y) ∧ ∃x · Q(x). Only the free x gets substituted.

Syntax, Continued Substitution 178/448


Examples: Substitution

Example. Let β be P(x) ∧ ∃x · Q(x). What is β[ y/x]?


β[ y/x] is P( y) ∧ ∃x · Q(x). Only the free x gets substituted.

Example. What about β[( y − 1)/z], where β is ∀x · ∃ y · x + y = z ?

Syntax, Continued Substitution 178/448


Examples: Substitution

Example. Let β be P(x) ∧ ∃x · Q(x). What is β[ y/x]?


β[ y/x] is P( y) ∧ ∃x · Q(x). Only the free x gets substituted.

Example. What about β[( y − 1)/z], where β is ∀x · ∃ y · x + y = z ?


At first thought, we might say ∀x · ∃ y · x + y = y − 1. But there’s a
problem—the free variable y in the term y − 1 got “captured” by the
quantifier ∃ y .

We want to avoid this capture.

Syntax, Continued Substitution 178/448


Avoiding Capture

Example. Formula α = S(x) ∧ ∀ y · P(x) → Q( y) ; term t = f ( y, y).
The leftmost x can be substituted by t since it is not in the scope of any
quantifier, but substituting in P(x) puts the variable y into the scope
of ∀ y .

We can prevent capture of variables in two ways.

• Declare that a substitution is undefined in cases where capture


would occur.
One can often evade problems by a different choice of variable.
(Above, we might be able to substitute f (z, z) instead of f ( y, y).
Or alter α to quantify some other variable.)
• Write the definition of substitution carefully, to prevent capture.

Huth and Ryan opt for the first method. We shall use the second.

Syntax, Continued Substitution 179/448


Substitution—Formal Definition

Let x be a variable and t a term.


For a term u, the term u[t/x] is u with each occurrence of the
variable x replaced by the term t .
For a formula α,

1. If α is P(t 1 , . . . , t k ), then α[t/x] is P t 1 [t/x], . . . , t k [t/x] .
2. If α is (¬β), then α[t/x] is (¬β[t/x]).
3. If α is (β ? γ), then α[t/x] is (β[t/x] ? γ[t/x]).
4. ...

(Continued next page. . . )

Syntax, Continued Substitution 180/448


Substitution—Formal Definition (2)
For variable x , term t and formula α:
..
.
4. If α is (Q x · β), then α[t/x] is α.
5. If α is (Q y · β) for some other variable y , then
(a) If y does not occur in t , then α[t/x] is (Q y · β[t/x]).
(b) Otherwise, select a variable z that occurs in neither α nor t ;
then α[t/x] is (Qz · (β[z/ y])[t/x]).

The last case prevents capture by renaming the quantified variable to


something harmless.

(Huth and Ryan specify that the substitution is undefined if capture would
occur—case 5(b) above. With this more complex definition, one never has to
add a condition regarding undefined substitutions. Substitution always behaves
“the way it should”.)
Syntax, Continued Substitution 181/448
Example, Revisited
Example. If α is ∀x · ∃ y · x + y = z , what is α[( y − 1)/z]?
This falls under case 5(b): the term to be substituted, namely y − 1,
contains a variable y quantified in formula α.
Let β be x + y = z ; thus α is ∀x · ∃ y · β .

Syntax, Continued Substitution 182/448


Example, Revisited
Example. If α is ∀x · ∃ y · x + y = z , what is α[( y − 1)/z]?
This falls under case 5(b): the term to be substituted, namely y − 1,
contains a variable y quantified in formula α.
Let β be x + y = z ; thus α is ∀x · ∃ y · β .
Select a new variable, say w. Then

β[w/ y] is x + w = z,

and
β[w/ y][( y − 1)/z] is x + w = y − 1.

Thus the required formula α[( y − 1)/z] is

∀x · ∃w· x + w = y − 1 .

Syntax, Continued Substitution 182/448


Semantics of Predicate Logic

Semantics 183/448
FOL Adds to Propositional Logic

In propositional logic, semantics was described in terms of valuations to


propositional atoms.
FOL includes more ingredients (i.e., predicates, functions, variables,
terms, constants, etc.) and, hence, the semantics for FOL must account
for all of the ingredients.
We already saw the concept of an interpretation, which specifies the
domain and the identities of the constants, relations and functions.
Formulas that include variables, and perhaps quantifiers, require
additional information, known as an environment (or assignment).

Semantics 184/448
Environments

A first-order environment is a function that assigns a value in the


domain to each variable.

Example. With the domain N, we might have environment θ1 given by


θ1 (x) = 9 and θ1 ( y) = 2.

If the interpretation specifies < is less-than, then x < y gets value false.

Example. With the domain of fictional animals, we might have


θ2 (x) = Tweety and θ2 ( y) = Nemo.

If the interpretation specifies < is “was created before”, then x < y gets
value true.

Semantics Environments 185/448


Constants Vs. Variables

Example: Let α1 be P(c) (c a constant), and let α2 be P(x) ( x a


variable).
Let M be the interpretation with domain N, c M = 2 and P M = “is even”.
Then αM
1 = T, but α2 is undefined.
M

To give α2 a value, we must also specify an environment. For example,


if θ (x) = 2, then α(2M,θ ) = T.

If we wish, we can consider a formula such as α2 that contains a free


variable x as expressing a function: the function that maps θ (x)
to α2(M,θ ) .

Semantics Environments 186/448


Meaning of Terms

The combination of an interpretation and an environment supplies a


value for every term.
Definition: Fix an interpretation M and environment θ . For each
term t , the value of t under M and θ , denoted t (M,θ ) , is as follows.

• If t is a constant c , the value t (M,θ ) is c M .


• If t is a variable x , the value t (M,θ ) is x θ .
(M,θ )
• If t is f (t 1 , . . . , t n ), the value t (M,θ ) is f M (t 1 , . . . , t n(M,θ ) ).

To extend this definition to formulas, we must consider quantifiers.

But first, a few examples.

Semantics Environments 187/448


Meaning of Terms—Example

Example. Suppose a language has constant symbol 0, a unary


function s, and a binary function +. We shall write + in infix position:
x + y instead of +(x, y).
 € Š
The expressions s s(0) + s(x) and s x + s x + s(0) are both terms.

The following are examples of interpretations and environments.

• dom{I } = {0, 1, 2, . . .}, 0I = 0, sI is the successor function and +I is


the addition operation. Then, if θ (x) = 3, the terms get values
€ Š(I ,θ )  € Š(I ,θ )
s s(0) + s(x) = 6 and s x + s x + s(0) = 9.

Semantics Environments 188/448


Meaning of Terms—Example 2

• dom{J } is the collection of all words over the alphabet {a, b},
0J = a ,
sJ appends a to the end of a string, and
+J is concatenation.
Let θ (x) = a ba. Then
€ Š(J ,θ )
s s(0) + s(x) = aaa baaa

and  € Š(J ,θ )
s x + s x + s(0) = a baa baaaaa .

Semantics Environments 189/448


Quantified Formulas

To evaluate the truthfulness of a formula ∀x · α (or ∃x · α), we should


check whether α holds for every (respectively, for some) value a in the
domain.

How can we express this precisely?

Definition: For any environment θ and domain element d, the


environment “ θ with x re-assigned to d”, denoted θ [x 7→ d],
is given by (
d if y is x
θ [x 7→ d]( y) =
θ ( y) if y is not x .

Semantics Environments 190/448


Values of Quantified Formulas

Definition: The values of ∀x · α and ∃x · α are given by


(
T if α(M,θ [x7→d]) = T for every d in dom(M)
• (∀x · α)(M,θ ) =
F otherwise
(
(M,θ ) T if α(M,θ [x7→d]) = T for some d in dom(M)
• (∃x · α) =
F otherwise

Note: The values of (∀x · α)(M,θ ) and (∃x · α)(M,θ ) do not depend on the
value of θ (x).
The value θ (x) only matters for free occurrences of x .

Semantics Environments 191/448


Examples: Value of a Quantified Formula

Example. Let dom(M ) = {a, b} and RM = { a, a , a, b , b, b }.


Let θ (x) = a and θ ( y) = b. We have

• R(x, x)(M,θ ) = T, since θ (x), θ (x) = a, a ∈ RM .

• R( y, x)(M,θ ) = F, since θ ( y), θ (x) = b, a ∈


/ RM .
(M,θ )
• ∃ y · R( y, x) = T, since R( y, x)(M,θ [ y7→a]) = T.
¬ ¶
(That is, θ [ y 7→ a]( y), θ [ y 7→ a](x) = a, a ∈ RM ).
(M,θ )
• What is ∀x · ∀ y · R(x, y) ?

Semantics Environments 192/448


Examples: Continued

Example. Let dom(M ) = {a, b} and RM = { a, a , a, b , b, b }.


Let θ (x) = a and θ ( y) = b.
(M,θ )
• What is ∀x · ∀ y · R(x, y) ?

/ RM , we have
Since b, a ∈

R(x, y)(M,θ [x7→ b][ y7→a]) = F ,

and thus (M,θ )


∀x · ∀ y · R(x, y) =F .

Semantics Environments 193/448


Examples: Continued

Example. Let dom(M ) = {a, b} and RM = { a, a , a, b , b, b }.


Let θ (x) = a and θ ( y) = b.
(M,θ )
• What is ∀x · ∀ y · R(x, y) ?

/ RM , we have
Since b, a ∈

R(x, y)(M,θ [x7→ b][ y7→a]) = F ,

and thus (M,θ )


∀x · ∀ y · R(x, y) =F .

(M,θ )
• What about ∀x · ∃ y · R(x, y) ?

Semantics Environments 193/448


A Question of Syntax

In the previous example, we wrote

R(x, y)(M,θ [x7→ b][ y7→a]) = F .

Why did we not write simply

R(b, a) = F

or perhaps
R(b, a)(M,θ ) = F ?

Semantics Environments 194/448


A Question of Syntax

In the previous example, we wrote

R(x, y)(M,θ [x7→ b][ y7→a]) = F .

Why did we not write simply

R(b, a) = F

or perhaps
R(b, a)(M,θ ) = F ?

Because “ R(b, a)” is not a formula. The elements a and b of dom(M)


are not symbols in the language; they cannot appear in a formula.

Semantics Environments 194/448


Satisfaction of Formulas
An interpretation M and environment θ satisfy a formula α, denoted
M |=θ α, if α(M,θ ) = T;
they do not satisfy α, denoted M 6|=θ α, if α(M,θ ) = F.

Form of α Condition for M |=θ α


D E
(M,θ ) (M,θ )
R(t 1 , . . . , t k ) t1 , . . . , tk ∈ RM
¬β M 6|=θ β
β ∧γ both M |=θ β and M |=θ γ
β ∨γ either M |=θ β or M |=θ γ (or both)
β →γ either M 6|=θ β or M |=θ γ (or both)
∀x · β for every a ∈ dom(M), M |=θ [x7→a] β
∃x · β there is some a ∈ dom(M) such that M |=θ [x7→a] β

If M |=θ α for every θ , then M satisfies α, denoted M |= α.


Semantics Satisfaction of Formulas 195/448
Example: Satisfaction

Example. Consider the formula ∃ y · R(x, y ⊕ y).


(For R a binary relation and ⊕ a binary function.)

Suppose dom(M) = {1, 2, 3, . . .},


⊕M is the addition operation, and
RM is the equality relation.

Then M |=θ ∃ y · R(x, y ⊕ y) iff θ (x) is an even number.

Semantics Satisfaction of Formulas 196/448


Validity and Satisfiability

Validity and satisfiability of formulas have definitions analogous to the


ones for propositional logic.
Definition: A formula α is

• valid if every interpretation and environment satisfy α; that is, if


M |= E α for every M and E ,
• satisfiable if some interpretation and environment satisfy α; that is,
if M |= E α for some M and E , and
• unsatisfiable if no interpretation and environment satisfy α; that is,
if M 6|= E α for every M and E .

(The term “tautology” is not used in predicate logic.)

Semantics Satisfaction of Formulas 197/448


Example: Satisfiability and Validity

€  Š
Let α be the formula P f g(x), g( y) , g(z) . The formula is satisfiable:

• dom(M): N
• f M : summation
• g M : squaring
• P M : equality
• θ (x) = 3, θ ( y) = 4 and θ (z) = 5.

α is not valid. (Why?)

Semantics Satisfaction of Formulas 198/448


Quantifiers Over Finite Domains

The universal and existential quantifiers may be understood respectively


as generalizations of conjunction and disjunction. If the domain
D = {a1 , . . . , ak } is finite then:

For all x , R(x) iff R(a1 ) and ... and R(ak )

There exists x , R(x) iff R(a1 ) or ... or R(ak )

where R is a property.

Semantics Satisfaction of Formulas 199/448


Relevance Lemma

Lemma:
Let α be a first-order formula, M be an interpretation, and θ1 and θ2 be
two environments such that

θ1 (x) = θ2 (x) for every x that occurs free in α.

Then
M |=θ1 α if and only if M |=θ2 α .

Proof by induction on the structure of α.

Semantics Satisfaction of Formulas 200/448


Logical Consequence

Suppose Σ is a set of formulas and α is a formula. We say that α is a


logical consequence of Σ, written as Σ |= α, iff for any interpretation M
and environment θ , we have M |=θ Σ implies M |=θ α.

|= α means that α is valid.

Semantics Satisfaction of Formulas 201/448


Example
 
Example: Show that |= ∀x ·(α → β) → (∀x · α) → (∀x · β) .

Proof by contradiction. Suppose there are M and θ such that


 
M 6|=θ ∀x ·(α → β) → (∀x · α) → (∀x · β) .

Then we must have M |=θ ∀x ·(α → β) and M 6|=θ (∀x · α) → (∀x · β);
the second gives M |=θ ∀x · α and M 6|=θ ∀x · β .
Using the definition of |= for formulas with ∀, we have
for every a ∈ dom(M), M |=θ [x7→a] α → β and M |=θ [x7→a] α.
Thus also M |=θ [x7→a] β for every a ∈ dom(M).
Thus M |=θ ∀x · β , a contradiction.

Semantics Satisfaction of Formulas 202/448


Example

Example. Show that ∀x · ¬γ |= ¬ ∃x · γ.

Semantics Satisfaction of Formulas 203/448


Example

Example. Show that ∀x · ¬γ |= ¬ ∃x · γ.

Suppose that M |=θ ∀x · ¬γ. By definition, this means

for every a ∈ dom(M), M |=θ [x7→a] ¬γ.

Again by definition (for a formula with ¬), this is equivalent to

for every a ∈ dom(M), M 6|=θ [x7→a] γ

and also

there is no a ∈ dom(M) such that M |=θ [x7→a] γ.

This last is the definition of M |=θ ¬ ∃x · γ, as required.

Semantics Satisfaction of Formulas 203/448


Example

Example: Show that, in general,

(∀x · α) → (∀x · β) 6|= ∀x ·(α → β) .

(That is, find α and β such that consequence does not hold.)

Semantics Satisfaction of Formulas 204/448


Example

Example: Show that, in general,

(∀x · α) → (∀x · β) 6|= ∀x ·(α → β) .

(That is, find α and β such that consequence does not hold.)

Key idea: α → β yields true whenever α is false.


Let α be R(x). Let M have domain {a, b} and RM = {a}. Then
M |= (∀x · α) → (∀x · β) for any β . (Why?)

Semantics Satisfaction of Formulas 204/448


Example

Example: Show that, in general,

(∀x · α) → (∀x · β) 6|= ∀x ·(α → β) .

(That is, find α and β such that consequence does not hold.)

Key idea: α → β yields true whenever α is false.


Let α be R(x). Let M have domain {a, b} and RM = {a}. Then
M |= (∀x · α) → (∀x · β) for any β . (Why?)

To obtain M 6|= ∀x ·(α → β), we can use ¬R(x) for β . (Why?)



Thus (∀x · α) → (∀x · β) 6|= ∀x ·(α → β), as required. (Why?)

Semantics Satisfaction of Formulas 204/448


Example

Example: for any formula α and term t ,

|= (∀x · α) → α[t/x] .

Semantics Satisfaction of Formulas 205/448


Proofs in First-Order Logic
Using Natural Deduction

Natural Deduction 206/448


Natural Deduction for FOL

Natural Deduction for FOL extends Natural Deduction for propositional


logic by including rules for introduction and elimination of quantifiers.

Other proof techniques and tricks remain the same as natural deduction
for propositional logic.

Natural Deduction 207/448


∀e and ∃i

Elimination of ∀ and introduction of ∃ are fairly straightforward.

Name ` -notation inference notation

∀-elimination If Σ ` ∀x · α ∀x · α
(∀e) then Σ ` α[t/x] α[t/x]

∃-introduction If Σ ` α[t/x], α[t/x]


(∃i) then Σ ` ∃x · α ∃x · α

Given that a formula is true for every value of x ,


conclude it is true for any particular value, such as that of t .
Given that a formula is true for a particular value (of t ),
conclude it is true for some value.

Natural Deduction ∀-Elimination and ∃-Introduction 208/448


Example: ∀e

“All fish can swim. Nemo is a fish. Therefore, Nemo can swim.”
In FOL: show that ∀x ·(F (x) → S(x)), F (Nemo) ` S(Nemo)..
Proof:

1. ∀x ·(F (x) → S(x)) Premise


2. F (Nemo) Premise
3. F (Nemo) → S(Nemo) ∀e: 1
4. S(Nemo) →i: 2, 3

The proof doesn’t care what F and S mean. Fishiness and swimming ability
really have nothing to do with the argument.

Natural Deduction ∀-Elimination and ∃-Introduction 209/448


Example: ∃i


Example. Show ¬P( y) ` ∃x · P(x) → Q( y) .

1. ¬P( y) Premise
2. P( y) Assumption
3. ⊥ ¬e: 2, 1
4. Q( y) ⊥e: 3
5. P( y) → Q( y) →i: 2–4

6. ∃x · P(x) → Q( y) ∃i: 5


(The last step could have produced ∃x · P(x) → Q(x) , if desired.)

Natural Deduction ∀-Elimination and ∃-Introduction 210/448


Soundness of ∀-Elimination and ∃-Introduction
Claim: For any formula ϕ , variable x and term t ,

∀x · ϕ |= ϕ[t/x] and ϕ[t/x] |= ∃xϕ .

Proof: Suppose M |= E Q x · ϕ ; i.e., for (every/some) d ∈ dom(M),

ϕ (M,E[x7→d]) = T .

Since d = t (M,E) is a domain value, it suffices to show

Claim II: For every formula ϕ , variable x and term t ,


(M,E)
ϕ[t/x](M,E) = ϕ (M,E[x7→ t ])
.

To prove this second claim, use the definition of substitution.


(Left to you. Cases 4, 5(a) and 5(b) of the definition make it work.)
Natural Deduction ∀-Elimination and ∃-Introduction 211/448
Proving a Universal
Our next rule is ∀-introduction, but we start with an example. To prove:

Sam is less than three meters tall.


How could you prove this?

Natural Deduction ∀-Introduction 212/448


Proving a Universal
Our next rule is ∀-introduction, but we start with an example. To prove:

Sam is less than three meters tall.


How could you prove this? Let’s re-phrase it:

The person named “Sam” is less than three meters tall.

Natural Deduction ∀-Introduction 212/448


Proving a Universal
Our next rule is ∀-introduction, but we start with an example. To prove:

Sam is less than three meters tall.


How could you prove this? Let’s re-phrase it:

The person named “Sam” is less than three meters tall.

If we have no information about who might have the name “Sam”, this is
essentially the same as

A person who might be referred to as “Sam” (or might not) is


less than three meters tall.

Natural Deduction ∀-Introduction 212/448


Proving a Universal
Our next rule is ∀-introduction, but we start with an example. To prove:

Sam is less than three meters tall.


How could you prove this? Let’s re-phrase it:

The person named “Sam” is less than three meters tall.

If we have no information about who might have the name “Sam”, this is
essentially the same as

A person who might be referred to as “Sam” (or might not) is


less than three meters tall.

More simply put,

Every person is less than three meters tall.


Natural Deduction ∀-Introduction 212/448
Rule ∀-Introduction

Definition: a variable is fresh in a subproof if it occurs nowhere outside


the box of the subproof.
Freshness captures the notion of “no information available”.

Name ` -notation inference notation


If Σ ` α[ y/x] and y fresh
∀-introduction y not free in Σ or α, ..
(∀i) .
α[ y/x]
then Σ ` ∀x · α
∀x · α

In words: in order to prove ∀x · α(x), prove α( y) for arbitrary y .

Natural Deduction ∀-Introduction 213/448


Rule ∀i Is Sound

To further clarify the rule ∀i, we show that it is sound. That is,

Suppose that Σ |= α[ y/x] and y is not free in Σ or α.


Then Σ |= ∀x · α.
Proof: Fix an arbitrary M and θ with M |=θ Σ.
The supposition Σ |= α[ y/x] thus requires M |=θ α[ y/x].
We need to show that M |=θ [x7→a] α for every a ∈ dom(M).
Consider an arbitrary a ∈ dom(M).
Since y is not free in Σ, the Relevance Lemma yields M |=θ [ y7→a] Σ.
Since y is not free in α, we have α[ y/x](M,θ [ y7→a]) = α(M,θ [x7→a]) .

Therefore M |=θ [x7→a] α for every a, and thus M |=θ ∀x · α as required.

Natural Deduction ∀-Introduction 214/448


Example: Use of ∀i

Example. Show that ¬ ∃x · α ` ∀x · ¬α, for any α.

1. ¬ ∃x · α Premise
2. u fresh

¬α[u/x] ??
n. ∀x · ¬α ∀i: 2–6

Note: “ u fresh” means we choose any variable not in α (and not x ).

Natural Deduction ∀-Introduction 215/448


Example: Use of ∀i

Example. Show that ¬ ∃x · α ` ∀x · ¬α, for any α.

1. ¬ ∃x · α Premise
2. u fresh
3. α[u/x] Assumption
4. ∃x · α ∃i: 3
5. ⊥ ¬e: 1, 4
6. ¬α[u/x] ¬i: 3–5
7. ∀x · ¬α ∀i: 2–6

Note: “ u fresh” means we choose any variable not in α (and not x ).

Natural Deduction ∀-Introduction 215/448


Example: Another use of ∀i

Show that ∀x ·(α → β) ` (∀x · α) → (∀x · β).

1. ∀x ·(α → β) Premise

(∀x · α) → (∀x · β) →i??

Note: do not apply rule ∀e until you know which term to use.

Natural Deduction ∀-Introduction 216/448


Example: Another use of ∀i

Show that ∀x ·(α → β) ` (∀x · α) → (∀x · β).

1. ∀x ·(α → β) Premise
2. ∀x · α Assumption

∀x · β ∀i???
8. (∀x · α) → (∀x · β) →i??

Note: do not apply rule ∀e until you know which term to use.

Natural Deduction ∀-Introduction 216/448


Example: Another use of ∀i

Show that ∀x ·(α → β) ` (∀x · α) → (∀x · β).

1. ∀x ·(α → β) Premise
2. ∀x · α Assumption
3. u fresh

6. β[u/x] ??
7. ∀x · β ∀i???
8. (∀x · α) → (∀x · β) →i??

Note: do not apply rule ∀e until you know which term to use.

Natural Deduction ∀-Introduction 216/448


Example: Another use of ∀i

Show that ∀x ·(α → β) ` (∀x · α) → (∀x · β).

1. ∀x ·(α → β) Premise
2. ∀x · α Assumption
3. u fresh
4. α[u/x] → β[u/x] ∀e: 1
5. α[u/x] ∀e: 2
6. β[u/x] →e: 4, 5
7. ∀x · β ∀i: 3–6
8. (∀x · α) → (∀x · β) →i: 2–7

Note: do not apply rule ∀e until you know which term to use.

Natural Deduction ∀-Introduction 216/448


Elimination of an Existential Quantifier

Name ` -notation inference notation


If Σ, α[u/x] ` β , α[u/x], u fresh
∃-elimination with u fresh, ..
(∃e) .
∃x · α β
then Σ, ∃x · α ` β
β

In ∃e, the variable u should not occur free in Σ, α, or β .


(Of course, u will normally be free in α[u/x].)

Natural Deduction ∃-Elimination 217/448


Rule ∃e Is Sound

The rule ∃e is sound. That is,

Suppose that Σ, α[u/x] |= β and u is not free in Σ, α, or β .


Then Σ, ∃x · α |= β .

Proof: Exercise. Follow the proof of soundness of ∀i.

Natural Deduction ∃-Elimination 218/448


Example: Use of ∃e

Example. Show that ∃x · R(x) ` ∃ y · R( y).

1. ∃x · R(x) Premise
2. R(u), u fresh Assumption
3. ∃ y · R( y) ∃i: 2 (term u)
4. ∃ y · R( y) ∃e: 1, 2–3

Natural Deduction ∃-Elimination 219/448


Extending the example?
Clearly, the previous proof did not depend on the particular relation R
that we used. Can we do the same proof for arbitrary formulas?
Does ∃x · α ` ∃ y · α[ y/x] hold?

1. ∃x · α Premise
2. α[u/x], u fresh Assumption
3. α[ y/x][u/ y] ????
4. ∃ y · α[ y/x] ∃i: 3 (term u)
5. ∃ y · α[ y/x] ∃e: 1, 2–4

Is the formula on line 2 the same as the one on line 3?

Natural Deduction ∃-Elimination 220/448


Extending the example?
Clearly, the previous proof did not depend on the particular relation R
that we used. Can we do the same proof for arbitrary formulas?
Does ∃x · α ` ∃ y · α[ y/x] hold?

1. ∃x · α Premise
2. α[u/x], u fresh Assumption
3. α[ y/x][u/ y] ????
4. ∃ y · α[ y/x] ∃i: 3 (term u)
5. ∃ y · α[ y/x] ∃e: 1, 2–4

Is the formula on line 2 the same as the one on line 3?


If y is free in α, then no — the derivation fails.
But otherwise, it works.
Natural Deduction ∃-Elimination 220/448
Example: ∃ and ∀ together

Example. Show that ∃x · ¬α ` ¬ ∀x · α.

1. ∃x · ¬α Premise

¬ ∀x · α ∃e ??

Natural Deduction ∃-Elimination 221/448


Example: ∃ and ∀ together

Example. Show that ∃x · ¬α ` ¬ ∀x · α.

1. ∃x · ¬α Premise
2. ¬α[u/x], u fresh Assumption

¬ ∀x · α ¬i ??
7. ¬ ∀x · α ∃e ??

Natural Deduction ∃-Elimination 221/448


Example: ∃ and ∀ together

Example. Show that ∃x · ¬α ` ¬ ∀x · α.

1. ∃x · ¬α Premise
2. ¬α[u/x], u fresh Assumption
3. ∀x · α Assumption
4. α[u/x] ∀e: 3
5. ⊥ ¬e: 4, 2
6. ¬ ∀x · α ¬i: 3–5
7. ¬ ∀x · α ∃e: 1, 2–6

Natural Deduction ∃-Elimination 221/448


Example: ∀e and ∃i together, again

We can interchange the quantifiers in the previous deduction.


Example. Show ∀x · ¬α ` ¬ ∃x · α.

1. ∀x · ¬α Assumption
2. ∃x · α Assumption
3. α[u/x] (u fresh) Assumption
4. ¬α[u/x] ∀e: 1
5. ⊥ ¬e: 3, 4
6. ⊥ ∃e: 2, 3–5
7. ¬ ∃x · α ¬i: 2–6

Natural Deduction ∃-Elimination 222/448


Quantifiers and Negation: The final case
So far, we have shown ¬ ∃x · α ` ∀x · ¬α,
∀x · ¬α ` ¬ ∃x · α, and
∃x · ¬α ` ¬ ∀x · α.
Example. Show that ¬ ∀x · α ` ∃x · ¬α.

1. ¬ ∀x · α Premise

¬α[t/x] ??
∃x · ¬α ∃i: ??

Natural Deduction ∃-Elimination 223/448


Quantifiers and Negation: The final case
So far, we have shown ¬ ∃x · α ` ∀x · ¬α,
∀x · ¬α ` ¬ ∃x · α, and
∃x · ¬α ` ¬ ∀x · α.
Example. Show that ¬ ∀x · α ` ∃x · ¬α.

1. ¬ ∀x · α Premise

¬α[t/x] ??
∃x · ¬α ∃i: ??

For what term t can we prove ¬α[t/x]?

Natural Deduction ∃-Elimination 223/448


Quantifiers and Negation: The final case
So far, we have shown ¬ ∃x · α ` ∀x · ¬α,
∀x · ¬α ` ¬ ∃x · α, and
∃x · ¬α ` ¬ ∀x · α.
Example. Show that ¬ ∀x · α ` ∃x · ¬α.

1. ¬ ∀x · α Premise

¬α[t/x] ??
∃x · ¬α ∃i: ??

For what term t can we prove ¬α[t/x]?


There is no such t !
We need to try something cleverer. . . .
Natural Deduction ∃-Elimination 223/448
The Final Case: A full proof
Example. Show that ¬ ∀x · α ` ∃x · ¬α.

1. ¬ ∀x · α Premise
2. ¬ ∃x · ¬α Assumption
3. u fresh
4. ¬α[u/x] Assumption
5. ∃x · ¬α ∃i: 4
6. ⊥ ¬e: 5, 2
7. ¬¬α[u/x] ¬i: 4–6
8. α[u/x] ¬¬e: 7
9. ∀x · α ∀i: 3–8
10. ⊥ ¬e: 9, 1
11. ¬¬ ∃x · ¬α ¬i: 2–10
12. ∃x · ¬α ¬¬e: 11

Natural Deduction ∃-Elimination 224/448


Repeated Quantifiers

The rules for elimination and introduction of quantifiers can be


generalized to multiple quantifiers.
Let x 1 , . . . , x n be n distinct variables.

• If Σ ` ∀x 1 · · · ∀x n · α, then Σ ` α[t 1 /x 1 ] · · ·[t n /x n ].


• If Σ ` α[t 1 /x 1 ] · · ·[t n /x n ], for terms t 1 , . . . , t n ,
then Σ ` ∃x 1 · · · ∃x n · α.
• If Σ ` α[u1 /x 1 ] · · ·[un /x n ], with variables u1 , . . . , un fresh,
then Σ ` ∀x 1 · · · ∀x n · α.
• If Σ ` ∃x 1 · · · ∃x n · α and Σ ∪ {α[u1 /x 1 ] · · ·[un /x n ] ` β , with
u1 , . . . , un fresh, then Σ ` β .

Natural Deduction ∃-Elimination 225/448


Example: Repeated universal quantifiers

Example. Show that ∀x · ∀ y · A(x, y) ` ∀ y · ∀x · A(x, y).

1. ∀x · ∀ y · A(x, y) Premise
2. u, v fresh
3. A(u, v) ∀e (×2): 1
4. ∀ y · ∀x · A(x, y) ∀i (×2): 3

Natural Deduction ∃-Elimination 226/448


Exercise on Quantifier Rules

Exercise. Show that


   
∀x · Q(x) → R(x) , ∃x · P(x) ∧ Q(x) ` ∃x · P(x) ∧ R(x) .

Left to you.

Natural Deduction ∃-Elimination 227/448


FOL with Equality

Generally, relation symbols have no mandated interpretation.


Sometimes, however, one makes an exception for the symbol =.
Definition: First-Order Logic with Equality is First-Order Logic with the
restriction that the symbol “ =” must be interpreted as equality on the
domain:
(=)I = 〈d, d〉 | d ∈ dom(I ) .


Symbol = gets its pair of deduction rules:

Equals-Introduction:
t = t =i

Equals-Elimination: t 1 = t 2 α[t 1 /x]


=e
α[t 2 /x]

Logic With Equality 228/448


Axioms for Equality

As an alternative to taking deduction rules for =, one can intead define


axioms for equality. An axiom is a premise that is always taken; it need
not be listed explicitly.

EQ1: ∀x · x = x is an axiom.
EQ2: For each formula α and variable z ,
€ Š
∀x · ∀ y · x = y → α[x/z] → α[ y/z]

is an axiom.

These axioms imply



• Symmetry of =: ` ∀x · ∀ y · x = y → y = x .

• Transitivity of =: ` ∀x · ∀ y · ∀w· x = y → ( y = w → x = w) .

Logic With Equality 229/448


Symmetry of Equality: Proof


Lemma. ` ∀x · ∀ y · x = y → y = x .

1.


∀x · ∀ y · x = y → y = x ∀i (×2): 1–?

Logic With Equality 230/448


Symmetry of Equality: Proof


Lemma. ` ∀x · ∀ y · x = y → y = x .

1. u, v fresh

u=v → v=u ???



∀x · ∀ y · x = y → y = x ∀i (×2): 1–?

Logic With Equality 230/448


Symmetry of Equality: Proof


Lemma. ` ∀x · ∀ y · x = y → y = x .

1. u, v fresh
2. u=v Assumption

v=u ??
u=v → v=u →i: 2–?

∀x · ∀ y · x = y → y = x ∀i (×2): 1–?

Logic With Equality 230/448


Symmetry of Equality: Proof


Lemma. ` ∀x · ∀ y · x = y → y = x .

1. u, v fresh
2. u=v Assumption
3. u=u =i

4. v=u =e: 2, 3 [ x = u]
5. u=v → v=u →i: 2–4

6. ∀x · ∀ y · x = y → y = x ∀i (×2): 1–5

Logic With Equality 230/448


Transitivity of Equality: Proof

Lemma. ` ∀x · ∀ y · ∀w· x = y → ( y = w → x = w)

1. u, v , w fresh
2. u=v Assumption
3. u=v → v=u Symmetry of =, + ∀e
4. v=u →e: 2, 3
5. v=w Assumption
6. u=w =e: 3, 5 [ x = w]
7. v=w→u=w →i: 5–6
8. u = v → (v = w → u = w) →i: 3–7
9. ∀x · ∀ y · ∀w·  ∀i (×3): 1–8
x = y → ( y = w → x = w)

Logic With Equality 231/448


Derived Proof Rules for Equality
Equality satisfies the following derived rules.

k-Way Transitivity:

EQtrans(k): t1 = t2 t2 = t3 · · · t k = t k+1 for any t 1 , . . . , t k+1 .


t 1 = t k+1

EQtrans(k) results from k − 1 uses of transitivity.

Substitution of Equals:
EQsubs( r ): t1 = t2 for any variable z and terms t 1 and t 2 .
r[t 1 /z] = r[t 2 /z]

Appling rule =e with formulas t 1 = t 2 and r[t 1 /z] = r[t 1 /z]


(from =i) yields the conclusion.

Logic With Equality 232/448


Soundness and Completeness of Natural Deduction

Theorem.

• Natural Deduction is sound for FOL: if Σ ` α, then Σ |= α.


• Natural Deduction is complete for FOL: if Σ |= α, then Σ ` α.

Proof outline:
Soundness: Each application of a rule is sound. By induction, any finite
number of rule applications is sound.
Completeness: We shall show the contrapositive:

if Σ 6` α, then Σ 6|= α .

We shall not give the full proof, but we will sketch the main points.

Soundness and Completeness 233/448


Completeness of ND for FOL: Getting started

To show: if Σ 6` α, then Σ 6|= α.

Lemma I: If Σ 6` α, then Σ ∪ {¬α} 6` α.

By rule →i, if Σ ∪ {¬α} ` α, then Σ ` ¬α → α. Thus Σ ` α.

Lemma II: If there are M and E s.t. M |= E Σ ∪ {¬α}, then Σ 6|= α.

M and E satisfy Σ but not α.

Lemma III (the big one):

If Σ ∪ {¬α} 6` α, then there are M and E such that M |= E Σ ∪ {¬α}.

Soundness and Completeness Sketch of Proof of Completeness 234/448


Whither a Domain?

Given: Σ ∪ {¬α} 6` α.
Required: interpretation D and environment E that satisfy Σ ∪ {¬α}.

To start, we need a domain. Where can we get one?

Soundness and Completeness Sketch of Proof of Completeness 235/448


Whither a Domain?

Given: Σ ∪ {¬α} 6` α.
Required: interpretation D and environment E that satisfy Σ ∪ {¬α}.

To start, we need a domain. Where can we get one?

Use terms as values! That is, let the domain be



ðtñ | t is a term .

We use the notation ‘ð ñ’ to indicate that we refer to the domain


element, rather than to the expression.

Soundness and Completeness Sketch of Proof of Completeness 235/448


Interpretation of Terms
For a set Σ of premises, we want an interpretation I and an
environment E , over the domain of terms.

Constants, variables, and functions are easy to handle.

• For a constant symbol c , we define c I = ðcñ.


• For a variable x , we define x E = ðxñ.
• For a k-ary function symbol f , we define
f I (ðt 1 ñ, . . . , ðt k ñ) = ð f (t 1 , . . . , t k )ñ.

Relations pose a problem, since they depend on Σ. For a relation


symbol R(k) , we must determine, for each tuple 〈t 1 , . . . , t k 〉, whether to
put ðt 1 ñ, . . . , ðt k ñ into the set RI .

The basic idea is to consider each possible tuple, one by one.


We suppress the details.
Soundness and Completeness Sketch of Proof of Completeness 236/448
One “Piece of the Puzzle”: Listing all formulas

As one part of the construction, we require a list of all possible formulas.


Since we may have arbitrarily many constant, variable, functions and
relation symbols, of any arity, we must take care that everything gets
onto the list at some point. For example, if we take the i th formula to
be R(ci ), then many formulas (R(x), Q 4 ( f7 ( y66 )), etc.) never appear on
the list.
We do the listing “in stages”, starting from stage 1. At stage j , consider
the first j constants, variables, and function symbols. Form all terms
that combine these, using at most j applications of a function. Apply
each of the first j relation symbols to each of these terms.
The set of formulas formed this way is large, but finite. After all have
been listed, continue to stage j + 1.

Soundness and Completeness Sketch of Proof of Completeness 237/448

You might also like