natural deduction for predicate logic - academia sinica

50
Natural Deduction for Predicate Logic Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan November 22, 2017 Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 1 / 50

Upload: others

Post on 12-Feb-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Natural Deduction for Predicate Logic - Academia Sinica

Natural Deduction for Predicate Logic

Bow-Yaw Wang

Institute of Information ScienceAcademia Sinica, Taiwan

November 22, 2017

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 1 / 50

Page 2: Natural Deduction for Predicate Logic - Academia Sinica

Outline

1 Predicate logic as a formal languageTermsFormulaeFree and bound variablesSubstitution

2 Proof theory of predicate logic

3 Quantifier equivalences

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 2 / 50

Page 3: Natural Deduction for Predicate Logic - Academia Sinica

Syntax

In our examples, there are two sorts of things:▸ B(x), M(x , y), B(x) ∧ ¬F (x) are formulae. They denote truth values;▸ y , paul , m(x) are terms. They denote objects.

Hence a predicate vocabulary has three sets.

P is a set of predicate symbols (B(x),M(x , y) etc).

F is a set of function symbols (m(x) etc).

C is a set of constant symbols (andy ,paul etc).

A function symbol f ∈ F with arity n (or n-arity) takes n arguments.

Observe that a 0-arity (or nullary) function is in fact a constant.

Hence C ⊆ F . We can ignore C for convenience.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 3 / 50

Page 4: Natural Deduction for Predicate Logic - Academia Sinica

Outline

1 Predicate logic as a formal languageTermsFormulaeFree and bound variablesSubstitution

2 Proof theory of predicate logic

3 Quantifier equivalences

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 4 / 50

Page 5: Natural Deduction for Predicate Logic - Academia Sinica

Terms

Definition

Terms are defined as follows.

Any variable is a term;

If c ∈ F is a nullary function symbol, c is a term;

If t1, t2, . . . , tn are terms and f ∈ F has arity n > 0, thenf (t1, t2, . . . , tn) is a term;

Nothing else is a term.

In Backus Naur form, we have

t ∶∶= x ∣ c ∣ f (t, . . . , t)

where x ∈ var is a variable, c ∈ F a nullary function symbol, and f ∈ Fa function symbol with arity > 0.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 5 / 50

Page 6: Natural Deduction for Predicate Logic - Academia Sinica

Terms

Let n, f ,g ∈ F be function symbols with arity 0, 1, and 2 respectively.

g(f (n),n), f (f (n)), f (g(n,g(f (n),n))) are terms.

g(n), f (n,n), n(g) are not terms.

Let 0,1, . . . be nullary function symbols, and +,−,× binary functionsymbols.

+(×(3, x),1), +(×(x , x),+(×(2,×(x , y))),×(y , y)) are terms.

In infix notation, they are (3×x)+1, (x ×x)+((2×(x ×y))+(y ×y)).

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 6 / 50

Page 7: Natural Deduction for Predicate Logic - Academia Sinica

Outline

1 Predicate logic as a formal languageTermsFormulaeFree and bound variablesSubstitution

2 Proof theory of predicate logic

3 Quantifier equivalences

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 7 / 50

Page 8: Natural Deduction for Predicate Logic - Academia Sinica

Formulae

Definition

Formulae are defined as follows.

If P ∈ P is a predicate symbol with arity n ≥ 1, and t1, t2, . . . tn areterms over F , then P(t1, t2, . . . , tn) is a formula;

If φ is a formula, so is (¬φ);

If φ and ψ are formulae, so are (φ ∧ ψ), (φ ∨ ψ), and (φ Ô⇒ ψ).

If φ is a formula and x is a variable, then (∀xφ) and (∃xφ) areformulae;

Nothing else is a formula.

In Backus Naur form, we have

φ ∶∶= P(t1, . . . , tn) ∣ (¬φ) ∣ (φ∧φ) ∣ (φ∨φ) ∣ (φ Ô⇒ φ) ∣ (∀xφ) ∣ (∃xφ)

where P ∈ P is a predicate symbol of arity n, t1, . . . , tn terms over F ,and x ∈ var a variable.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 8 / 50

Page 9: Natural Deduction for Predicate Logic - Academia Sinica

Convention

It is very tedious to write parentheses.

We will assume the following binding priorities.▸ ¬, ∀x and ∃x (tightest)▸ ∨, ∧▸ Ô⇒ (right-associative and loosest)

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 9 / 50

Page 10: Natural Deduction for Predicate Logic - Academia Sinica

Parse Tree

∀x

Ô⇒

P

x

Q

x

S

x y

A predicate logic formula can be represented as a parse tree.▸ ∀x , ∃y are nodes;▸ arguments of function symbols are also nodes.

The above figure gives the parse tree of∀x((P(x) Ô⇒ Q(x)) ∧ S(x , y)).

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 10 / 50

Page 11: Natural Deduction for Predicate Logic - Academia Sinica

Example

Example

Write “every son of my father is my brother” in predicate logic.

Proof.

Let me denote ’me’, S(x , y) (x is a son of y), F (x , y) (x is the father ofy), and B(x , y) (x is a brother of y) be predicate symbols of arity 2.Consider

∀x∀y(F (x ,me) ∧ S(y , x) Ô⇒ B(y ,me)).

Alternatively, let f (f (x) is the father of x) be a unary function symbol.Consider

∀x(S(x , f (me)) Ô⇒ B(x ,me)).

Translating an English sentence into predicate logic can be tricky.

Can you identify problem(s) in the example?

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 11 / 50

Page 12: Natural Deduction for Predicate Logic - Academia Sinica

Outline

1 Predicate logic as a formal languageTermsFormulaeFree and bound variablesSubstitution

2 Proof theory of predicate logic

3 Quantifier equivalences

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 12 / 50

Page 13: Natural Deduction for Predicate Logic - Academia Sinica

Constants and Variables

Let c ,d be constants (nullary functions).

Consider ∀x(P(x) Ô⇒ Q(x)) ∧ P(c) Ô⇒ Q(c).▸ If P(x) implies Q(x) for all x and P(c) is true, then Q(c) is true.

Intuitively, ∀y(P(y) Ô⇒ Q(y)) ∧ P(c) Ô⇒ Q(c) should have thesame meaning.

∀y(P(y) Ô⇒ Q(y)) ∧ P(d) Ô⇒ Q(d) is different.▸ We do not know if Q(c) is true.

Things can get very complicated when there are several variables.▸ ∀x((P(x) Ô⇒ Q(x)) ∧ S(x , y))▸ ∀z((P(z) Ô⇒ Q(z)) ∧ S(z , y))▸ ∀y((P(y) Ô⇒ Q(y)) ∧ S(y , x))

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 13 / 50

Page 14: Natural Deduction for Predicate Logic - Academia Sinica

Free and Bound Variables

Definition

Let φ be a predicate logic formula. An occurrence of x in φ is free in φ ifit is a leaf node without ancestor nodes ∀x or ∃x in the parse tree of φ.Otherwise, the occurrence of x is bound. The scope of ∀x in ∀xφ is theformula φ minus any subformula in φ of the form ∀xψ or ∃xψ.

Ô⇒

∀x

P

x

Q

x

¬

P

x

Q

y

(∀x(P(x) ∧Q(x))) Ô⇒ (¬P(x) ∨Q(y))

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 14 / 50

Page 15: Natural Deduction for Predicate Logic - Academia Sinica

Outline

1 Predicate logic as a formal languageTermsFormulaeFree and bound variablesSubstitution

2 Proof theory of predicate logic

3 Quantifier equivalences

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 15 / 50

Page 16: Natural Deduction for Predicate Logic - Academia Sinica

Subsitution

Variables denote objects in predicate logic.

Hence variables can be replaced by terms (but not formulae).▸ Replace x in x ≠ x + 1 by 2 to get 2 ≠ 2 + 1.▸ What if we replace x by 2 = 2?

However, bound variables should not be replaced.

The variables x and y in ∀xφ and ∃yψ denote all or some objectsrespectively.

▸ What if we replace x in ∃x(x = 0) by 1?

Definition

Given a variable x , a term t and a formula φ, define φ[t/x] to be theformula obtained by replacing each free occurrence of x in φ with t.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 16 / 50

Page 17: Natural Deduction for Predicate Logic - Academia Sinica

Example

Let φ = (∀x(P(x) ∧Q(x))) Ô⇒ (¬P(x) ∨Q(y)). Considerφ[f (x , y)/x].

Ô⇒

∀x

P

x

Q

x

¬

P

f

x y

Q

y

(∀x(P(x) ∧Q(x))) Ô⇒ (¬P(x) ∨Q(y))[f (x , y)/x]

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 17 / 50

Page 18: Natural Deduction for Predicate Logic - Academia Sinica

Variable Capture in Substitution

Let φ = ∃y(y < x) and ψ = ∃z(z < x).▸ Since φ and ψ only differ in bound variables, they should have the

same meaning.

Consider φ[(y − 1)/x] = ∃y(y < y − 1).

The variable y in y − 1 is caught by the bound variable in φ.

Consider ψ[(y − 1)/x] = ∃z(z < y − 1).

The variable y in y − 1 is not caught in the substitution ψ[(y − 1)/x].

Definition

Let t be a term, x a variable, and φ a formula. t is free for x in φ if nofree x leaf in φ occurs in the scope of ∀y or ∃y for any variable yoccurring in t.

Examples: y − 1 is free for x in ∃z(z < x); y − 1 is not free for x in∃y(y < x).

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 18 / 50

Page 19: Natural Deduction for Predicate Logic - Academia Sinica

Example

S

x

∀y

Ô⇒

P

x

Q

y

Consider φ = S(x) ∧ ∀y(P(x) Ô⇒ Q(y)) and t = f (y , y).

The two occurrences of x in φ are free.

The right occurrence of x in φ is in the scope of ∀y and y occurs in t.

t is not free for x in φ.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 19 / 50

Page 20: Natural Deduction for Predicate Logic - Academia Sinica

Substitution and Variable Capture

When t is not free for x in φ, the substitution φ[t/x] is not desirable.

However, we can always rename bound variables for substitution.

When we write φ[t/x], we mean all bound variables in φ are renamedso that t is free for x in φ.

Examples.▸ φ = ∃y(y < x) and t = y − 1. t is not free for x in φ. Rename the

bound variable y to z and obtain ψ = ∃z(z < x). t is free for x in ψ.▸ φ = S(x) ∧ ∀y(P(x) Ô⇒ Q(y)) and t = f (y , y). t is not free for x inφ. Rename the bound variable y to z and obtainψ = S(x) ∧ ∀z(P(x) Ô⇒ Q(z)). t is free for x in ψ.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 20 / 50

Page 21: Natural Deduction for Predicate Logic - Academia Sinica

Outline

1 Predicate logic as a formal language

2 Proof theory of predicate logic

3 Quantifier equivalences

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 21 / 50

Page 22: Natural Deduction for Predicate Logic - Academia Sinica

Natural Deduction for Predicate Logic

Similar to propositional logic, predicate logic has its natural deductionproof system.

Naturally, the natural deduction proof rules for contradiction (�),negation (¬), and Boolean connectives (∨, ∧, Ô⇒ ) are the same asthose in propositional logic.

Additionally, there are proof rules for equality (=) and quantification(∀ and ∃).

Again, these additional rules have two types: introduction andelimination rules.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 22 / 50

Page 23: Natural Deduction for Predicate Logic - Academia Sinica

Equality

Let s and t be terms.

What do we mean by s = t?

Shall we say 2 + 1 = 2 + 1?

What about 261 − 1 = 2305843009213693951?

Apparently, if two terms are syntactically equal, they are equal.▸ This is called intensional equality.

In practice, if two terms denote the same object, they are equal.▸ This is called extensional equality.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 23 / 50

Page 24: Natural Deduction for Predicate Logic - Academia Sinica

Natural Deduction Proof Rules for Equality

The introduction rule for equality is as follows.

t = t = i

The elimination rule for equality is as follows.

t1 = t2 φ[t1/x]

φ[t2/x]= e

(t1 and t2 are free for x in φ).▸ The requirement “t1 and t2 are free for x in φ” is called the side

condition of the proof rule.

By convention, we assume the side condition holds in all substitutions.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 24 / 50

Page 25: Natural Deduction for Predicate Logic - Academia Sinica

Example

Example

Showx + 1 = 1 + x , (x + 1) > 1 Ô⇒ (x + 1) > 0 ⊢ (1 + x) > 1 Ô⇒ (1 + x) > 0.

Proof.

1 x + 1 = 1 + x premise2 (x + 1) > 1 Ô⇒ (x + 1) > 0 premise3 (1 + x) > 1 Ô⇒ (1 + x) > 0 =e 1, 2

In step 3, take φ = x > 1 Ô⇒ x > 0, t1 = x + 1, and t2 = 1 + x . Thenφ[t1/x] = (x + 1) > 1 Ô⇒ (x + 1) > 0,φ[t2/x] = (1 + x) > 0 Ô⇒ (1 + x) > 0.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 25 / 50

Page 26: Natural Deduction for Predicate Logic - Academia Sinica

Reflexivity of Equality

Example

Show t1 = t2 ⊢ t2 = t1.

Proof.

1 t1 = t2 premise2 t1 = t1 =i3 t2 = t1 =e, 1, 2

Take φ = (x = t1). φ[t1/x] = (t1 = t1) and φ[t2/x] = (t2 = t1).

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 26 / 50

Page 27: Natural Deduction for Predicate Logic - Academia Sinica

Transitivity of Equality

Example

Show t1 = t2, t2 = t3 ⊢ t1 = t3.

Proof.

1 t2 = t3 premise2 t1 = t2 premise3 t1 = t3 =e, 1, 2

Take φ = (t1 = x). φ[t2/x] = (t1 = t2) and φ[t3/x] = (t1 = t3).

Thus, the rules =i and =e give us the reflexity, symmetry, andtransitivity of equality.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 27 / 50

Page 28: Natural Deduction for Predicate Logic - Academia Sinica

Natural Deduction Proof Rules for Universal Quantification

The elimination rule for universal quantification is the following:

∀xφ

φ[t/x]∀xe

when t is free for x in φ.

To see why t must be free for x in φ, let φ be ∃y(x < y). For naturalnumbers, ∀x∃y(x < y) is clearly true (“for any number, there is alarger number”). But if we take t = y , φ[t/x] = ∃y(y < y). This iswrong. Hence t must be free for x in φ.

▸ If we really need to replace x by y in this case, we should rewrite∃y(x < y) to ∃z(x < z) and obtain ∃z(x < z)[x/y] = ∃z(y < z).

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 28 / 50

Page 29: Natural Deduction for Predicate Logic - Academia Sinica

Natural Deduction Proof Rules for Universal Quantification

The introduction rule for universal quantification opens a new box fora fresh variable x0:

x0 ....φ[x0/x]

∀xφ∀xi

(By “fresh,” we mean x0 does not occur outside of the box.)

Informally, the rule ∀x i says “if we can establish φ[x0/x] for a freshx0, then we can derive ∀xφ.”

▸ Intuitively, x0 can be an arbitrary term since it is fresh and assumesnothing. If we can show φ[x0/x], we have ∀xφ.

▸ Another way to see this is to replace x0 by a term t in the box. Wewould have a proof for φ[t/x]. That is, we have shown ∀xφ.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 29 / 50

Page 30: Natural Deduction for Predicate Logic - Academia Sinica

Example

Example

Show ∀x(P(x) Ô⇒ Q(x)),∀xP(x) ⊢ ∀xQ(x).

Proof.

1 ∀x(P(x) Ô⇒ Q(x)) premise2 ∀xP(x) premise3 x0 P(x0) Ô⇒ Q(x0) ∀xe 1 ⌉

4 P(x0) ∀xe 2 ∣

5 Q(x0) Ô⇒ e 4, 3 ⌋

6 ∀xQ(x) ∀x i 3–5

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 30 / 50

Page 31: Natural Deduction for Predicate Logic - Academia Sinica

Example

Example

Show P(t),∀x(P(x) Ô⇒ ¬Q(x)) ⊢ ¬Q(t) for any term t.

Proof.

1 P(t) premise2 ∀x(P(x) Ô⇒ ¬Q(x)) premise3 P(t) Ô⇒ ¬Q(t) ∀xe 24 ¬Q(t) Ô⇒ e 1, 3

In step 3, we apply ∀xe by replacing x with t. We could apply thesame rule with a different term, say, a. Hence the rule ∀xe is in fact ascheme of rules; one for each term t (free of x in φ).

Also, we have different introduction and elimination rule. for differentvariables. That is, we have ∀x i, ∀xe, ∀y i, ∀ye, and so on. We willsimply write ∀i and ∀ e when bound variables are clear.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 31 / 50

Page 32: Natural Deduction for Predicate Logic - Academia Sinica

Universal Quantification and Conjunction

It is helpful to compare proof rules for universal quantification andconjunction.

Introduction rules:▸ To establish ∀xφ, we need to show φ[t/x] for any term t. This is

accomplished by proving φ[x0/x] with the box for a fresh variable x0;▸ To establish φ ∧ ψ, we need to show φ and ψ.

Elimination rules:▸ To eliminate ∀xφ, we pick a term (free for x in φ) and deduce φ[t/x];▸ To eliminate φ ∧ ψ, we deduce φ (or ψ).

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 32 / 50

Page 33: Natural Deduction for Predicate Logic - Academia Sinica

Natural Deduction Proof Rule for Existential Quantification

The introduction rule for existential quantification is as follows.

φ[t/x]

∃xφ∃xi

when t is free for x in φ.

To see why t must be free for x in φ, consider ∃x∀y(x = y). This isclearly wrong for, say, natural numbers. Let φ = ∀y(x = y) and t = y .Since φ[t/x] = ∀y(y = y) is deducible (=i, ∀y i), we would have∃x∀y(x = y).

Recall the elimination rule for universal quantification:

∀xφ

φ[t/x]∀xe

when t is free for x in φ.∀xe is the “dual” of ∃x i.

▸ Recall the duality of ∧e and ∨i.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 33 / 50

Page 34: Natural Deduction for Predicate Logic - Academia Sinica

Natural Deduction Proof Rule for Existential Quantification

The elimination rule for existential quantification is as follows.

∃xφ

x0φ[x0/x]....

χ

χ ∃xe

Informally, the rule ∃xe says: to show χ from ∃xφ, we show χ byassuming φ[x0/x] for a fresh variable x0.

▸ Intuitively, x0 stands for an unknown term t such that φ[t/x] holds. Ifwe can deduce χ by assuming φ[t/x], then χ is deducible from ∃xφ.

Note that x0 must not occur in χ.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 34 / 50

Page 35: Natural Deduction for Predicate Logic - Academia Sinica

Existential Quantification and Disjunction

It is helpful to compare the elimination rules for existentialquantification and disjunction.

Recall

φ ∨ ψ

φ....χ

ψ....χ

χ ∨e

To eliminate φ ∨ ψ, we show that χ is deducible by assuming φ orassuming ψ.

To eliminate ∃xφ, we show that χ is deducible by assuming φ[x0/x].

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 35 / 50

Page 36: Natural Deduction for Predicate Logic - Academia Sinica

Subformula Property I

An elimination rule has subformula property if it must conclude with asubformula of the eliminated formula.

For example, both ∧e1 and ¬e have the subformula property.

φ ∧ ψ

φ∧e1

¬¬φ

φ¬¬e

Since the conclusion of ∀xe has the same logical structure as theeliminated formula, we also say ∀xe has the subformula property.

∀xφ

φ[t/x]∀xe

▸ Strictly speaking, φ[t/x] may not be a subformula of ∀xφ.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 36 / 50

Page 37: Natural Deduction for Predicate Logic - Academia Sinica

Subformula Property II

The subformula property helps proof search.▸ We need not invent a formula for rules with the property.▸ Such rules are good for automated proof search.

∨e and ∃xe however do not have the subformula property.

φ ∨ ψ

φ....χ

ψ....χ

χ ∨e

∃xφ

x0φ[x0/x]....

χ

χ ∃xe

▸ The conclusion χ must be chosen carefully.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 37 / 50

Page 38: Natural Deduction for Predicate Logic - Academia Sinica

Examples I

Example

Show ∀xφ ⊢ ∃xφ.

Proof.

1 ∀xφ premise2 φ[x/x] ∀xe 13 ∃xφ ∃x i 2

(Is x free for x in φ[x/x]?)

Is it correct?

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 38 / 50

Page 39: Natural Deduction for Predicate Logic - Academia Sinica

Examples II

Example

Show ∀x(P(x) Ô⇒ Q(x)),∃xP(x) ⊢ ∃xQ(x).

Proof.

1 ∀x(P(x) Ô⇒ Q(x)) premise2 ∃xP(x) premise3 x0 P(x0) assumption ⌉

4 P(x0) Ô⇒ Q(x0) ∀xe 1 ∣

5 Q(x0) Ô⇒ e 3, 4 ∣

6 ∃xQ(x) ∃x i 5 ⌋

7 ∃xQ(x) ∃xe 2, 3–6(Can we close the box at line 5 instead of 6? Why not?)

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 39 / 50

Page 40: Natural Deduction for Predicate Logic - Academia Sinica

Examples III

Example

Show ∃xP(x),∀x∀y(P(x) Ô⇒ Q(y)) ⊢ ∀yQ(y).

Proof.

1 ∃xP(x) premise2 ∀x∀y(P(x) Ô⇒ Q(y)) premise3 y0 ⌉

4 x0 P(x0) assumption ⌉ ∣

5 ∀y(P(x0) Ô⇒ Q(y)) ∀xe 2 ∣ ∣

6 P(x0) Ô⇒ Q(y0) ∀ye 5 ∣ ∣

7 Q(y0) Ô⇒ e 4, 6 ⌋ ∣

8 Q(y0) ∃xe 1, 4–7 ⌋

9 ∀yQ(y) ∀y i 3–8

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 40 / 50

Page 41: Natural Deduction for Predicate Logic - Academia Sinica

Box Box Box I

Fresh variables in box must not appear outside!

If not, we could show ∃xP(x),∀x(P(x) Ô⇒ Q(x)) ⊢ ∀yQ(y)!1 ∃xP(x) premise2 ∀x(P(x) Ô⇒ Q(x)) premise3 x0 ⌉

4 x0 P(x0) assumption ⌉ ∣

5 P(x0) Ô⇒ Q(x0) ∀xe 2 ∣ ∣

6 Q(x0) Ô⇒ e 4, 5 ⌋ ∣

7 Q(x0) ∃xe 1, 4–6 ⌋

8 ∀yQ(y) ∀y i 3–7

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 41 / 50

Page 42: Natural Deduction for Predicate Logic - Academia Sinica

Outline

1 Predicate logic as a formal language

2 Proof theory of predicate logic

3 Quantifier equivalences

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 42 / 50

Page 43: Natural Deduction for Predicate Logic - Academia Sinica

Equivalent Predicate Logic Formulae I

Let φ and ψ be predicate logic formulae.

φ ⊣⊢ ψ denotes tha φ ⊢ ψ and ψ ⊢ φ.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 43 / 50

Page 44: Natural Deduction for Predicate Logic - Academia Sinica

Equivalent Predicate Logic Formulae II

Theorem

Let φ and ψ be predicate logic formulae. We have

1 (a) ¬∀xφ ⊣⊢ ∃x¬φ; (b) ¬∃xφ ⊣⊢ ∀x¬φ.

2 When x is not free in ψ:(a) ∀xφ ∧ ψ ⊣⊢ ∀x(φ ∧ ψ); (b) ∀xφ ∨ ψ ⊣⊢ ∀x(φ ∨ ψ);(c) ∃xφ ∧ ψ ⊣⊢ ∃x(φ ∧ ψ); (d) ∃xφ ∨ ψ ⊣⊢ ∃x(φ ∨ ψ);(e) ∀x(ψ Ô⇒ φ) ⊣⊢ ψ Ô⇒ ∀xφ;(f) ∃x(φ Ô⇒ ψ) ⊣⊢ ∀xφ Ô⇒ ψ;(g) ∀x(φ Ô⇒ ψ) ⊣⊢ ∃xφ Ô⇒ ψ;(h) ∃x(ψ Ô⇒ φ) ⊣⊢ ψ Ô⇒ ∃xφ .

3 (a) ∀xφ ∧ ∀xψ ⊣⊢ ∀x(φ ∧ ψ); (b) ∃xφ ∨ ∃xψ ⊣⊢ ∃(φ ∨ ψ).

4 (a) ∀x∀yφ ⊣⊢ ∀y∀xφ (b) ∃x∃yφ ⊣⊢ ∃y∃xφ.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 44 / 50

Page 45: Natural Deduction for Predicate Logic - Academia Sinica

¬∀xφ ⊢ ∃x¬φ

1 ¬∀xφ premise2 ¬∃x¬φ assumption ⌉

3 x0 ⌉ ∣

4 ¬φ[x0/x] assumption ⌉ ∣ ∣

5 ∃x¬φ ∃x i 4 ∣ ∣ ∣

6 � ¬e 5, 2 ⌋ ∣ ∣

7 φ[x0/x] PBC 4–6 ⌋ ∣

8 ∀xφ ∀x i 3–7 ∣

9 � ¬e 8, 1 ⌋

10 ∃x¬φ PBC 2–9

The proof structure is similar to ¬(p1 ∧ p2) ⊢ ¬p1 ∨ ¬p2.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 45 / 50

Page 46: Natural Deduction for Predicate Logic - Academia Sinica

¬(p1 ∧ p2) ⊢ ¬p1 ∨ ¬p2

1 ¬(p1 ∧ p2) premise2 ¬(¬p1 ∨ ¬p2) assumption ⌉

3 ¬p1 assumption ⌉ ∣

4 ¬p1 ∨ ¬p2 ∨i1 3 ∣ ∣

5 � ¬e 4, 2 ⌋ ∣

6 p1 PBC 3–5 ∣

3’ ¬p2 assumption ⌉ ∣

4’ ¬p1 ∨ ¬p2 ∨i2 3’ ∣ ∣

5’ � ¬e 4’, 2’ ⌋ ∣

6’ p2 PBC 3’–5’ ∣

7 p1 ∧ p2 ∧i 6, 6’ ∣

8 � ¬e 7, 1 ⌋

9 ¬p1 ∨ ¬p2 PBC 2–8.

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 46 / 50

Page 47: Natural Deduction for Predicate Logic - Academia Sinica

∃x¬φ ⊢ ¬∀xφ

1 ∃x¬φ premise2 ∀xφ assumption ⌉

3 x0 ¬φ[x0/x] assumption ⌉ ∣

4 φ[x0/x] ∀e 2 ∣ ∣

5 � ¬e 4, 3 ⌋ ∣

6 � ∃xe 1, 3–5 ⌋

7 ¬∀xφ ¬i 2–6

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 47 / 50

Page 48: Natural Deduction for Predicate Logic - Academia Sinica

∀xφ ∧ ψ ⊢ ∀x(φ ∧ ψ) and ∀x(φ ∧ ψ) ⊢ ∀xφ ∧ ψ (x not free in ψ)

1 (∀xφ) ∧ ψ premise2 ∀xφ ∧e1 13 ψ ∧e2 24 x0 ⌉

5 φ[x0/x] ∀xe 2 ∣

6 φ[x0/x] ∧ ψ ∧i 5, 3 ∣

7 (φ ∧ ψ)[x0/x] x not free in ψ ⌋

8 ∀x(φ ∧ ψ) ∀x i 4–7

1 ∀x(φ ∧ ψ) premise2 x0 ⌉

3 (φ ∧ ψ)[x0/x] ∀xe 1 ∣

4 φ[x0/x] ∧ ψ x not free in ψ ∣

5 ψ ∧e2 4 ∣

6 φ[x0/x] ∧e1 4 ⌋

7 ∀xφ ∀x i 2–68 ∀xφ ∧ ψ ∧i 7, 5

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 48 / 50

Page 49: Natural Deduction for Predicate Logic - Academia Sinica

(∃xφ) ∨ (∃xψ) ⊢ ∃x(φ ∨ ψ)

1 (∃xφ) ∨ (∃xψ) premise2 ∃xφ assumption ⌉

3 x0 φ[x0/x] assumption ⌉ ∣

4 φ[x0/x] ∨ ψ[x0/x] ∨i1 3 ∣ ∣

5 (φ ∨ ψ)[x0/x] same as 4 ∣ ∣

6 ∃x(φ ∨ ψ) ∃x i 5 ⌋ ∣

7 ∃x(φ ∨ ψ) ∃xe 2, 3–6 ⌋

2’ ∃xψ assumption ⌉

3’ y0 ψ[y0/x] assumption ⌉ ∣

4’ φ[y0/x] ∨ ψ[y0/x] ∨i2 3’ ∣ ∣

5’ (φ ∨ ψ)[y0/x] same as 4’ ∣ ∣

6’ ∃x(φ ∨ ψ) ∃x i 5’ ⌋ ∣

7’ ∃x(φ ∨ ψ) ∃xe 2’, 3’–6’ ⌋

8 ∃x(φ ∨ ψ) ∨e 1, 2–7, 2’–7’

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 49 / 50

Page 50: Natural Deduction for Predicate Logic - Academia Sinica

∃x∃yφ ⊢ ∃y∃xφ

1 ∃x∃yφ premise2 x0 (∃yφ)[x0/x] assumption ⌉

3 ∃y(φ[x0/x]) x and y different ∣

4 y0 φ[x0/x][y0/y] assumption ⌉ ∣

5 φ[y0/y][x0/x] x , y , x0, y0 different ∣ ∣

6 ∃xφ[y0/y] ∃x i 5 ∣ ∣

7 ∃y∃xφ ∃y i 6 ⌋ ∣

8 ∃y∃xφ ∃ye 3, 4–7 ⌋

9 ∃y∃xφ ∃xe 1, 2–8

Bow-Yaw Wang (Academia Sinica) Natural Deduction for Predicate Logic November 22, 2017 50 / 50