Logic as a Tool Chapter 3: Understanding First-order Logic 3.3 - - PowerPoint PPT Presentation

logic as a tool chapter 3 understanding first order logic
SMART_READER_LITE
LIVE PREVIEW

Logic as a Tool Chapter 3: Understanding First-order Logic 3.3 - - PowerPoint PPT Presentation

Logic as a Tool Chapter 3: Understanding First-order Logic 3.3 Basic grammar and use of first-order languages Valentin Goranko Stockholm University November 2020 Goranko Free and bound variables intuitively Goranko Free and bound variables


slide-1
SLIDE 1

Goranko

Logic as a Tool Chapter 3: Understanding First-order Logic 3.3 Basic grammar and use of first-order languages

Valentin Goranko Stockholm University November 2020

slide-2
SLIDE 2

Goranko

Free and bound variables intuitively

slide-3
SLIDE 3

Goranko

Free and bound variables intuitively

Two essentially different ways in which we use individual variables in first-order formulae:

slide-4
SLIDE 4

Goranko

Free and bound variables intuitively

Two essentially different ways in which we use individual variables in first-order formulae:

  • 1. Free variables: used to denote unknown or unspecified objects, as in

(5 < x) ∨ (x2 + x − 2 = 0)

slide-5
SLIDE 5

Goranko

Free and bound variables intuitively

Two essentially different ways in which we use individual variables in first-order formulae:

  • 1. Free variables: used to denote unknown or unspecified objects, as in

(5 < x) ∨ (x2 + x − 2 = 0)

  • r L(m(x), x)

( “The mother of x loves x”)

slide-6
SLIDE 6

Goranko

Free and bound variables intuitively

Two essentially different ways in which we use individual variables in first-order formulae:

  • 1. Free variables: used to denote unknown or unspecified objects, as in

(5 < x) ∨ (x2 + x − 2 = 0)

  • r L(m(x), x)

( “The mother of x loves x”)

  • 2. Bound variables: used to quantify, as in

∃x((5 < x) ∨ (x2 + x − 2 = 0)) and ∀x((5 < x) ∨ (x2 + x − 2 = 0))

slide-7
SLIDE 7

Goranko

Free and bound variables intuitively

Two essentially different ways in which we use individual variables in first-order formulae:

  • 1. Free variables: used to denote unknown or unspecified objects, as in

(5 < x) ∨ (x2 + x − 2 = 0)

  • r L(m(x), x)

( “The mother of x loves x”)

  • 2. Bound variables: used to quantify, as in

∃x((5 < x) ∨ (x2 + x − 2 = 0)) and ∀x((5 < x) ∨ (x2 + x − 2 = 0)) and ∀xL(m(x), x) ( “Everybody is loved by his/her mother”)

slide-8
SLIDE 8

Goranko

Scope of a quantifier. Bound and free occurrences of variables.

slide-9
SLIDE 9

Goranko

Scope of a quantifier. Bound and free occurrences of variables.

Scope of (an occurrence of) a quantifier Q in a given formula A (where Q ∈ {∀, ∃}) is the unique subformula QxB beginning with that

  • ccurrence of the quantifier Q in A.
slide-10
SLIDE 10

Goranko

Scope of a quantifier. Bound and free occurrences of variables.

Scope of (an occurrence of) a quantifier Q in a given formula A (where Q ∈ {∀, ∃}) is the unique subformula QxB beginning with that

  • ccurrence of the quantifier Q in A.

Some examples of scopes of quantifiers: ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))).

slide-11
SLIDE 11

Goranko

Scope of a quantifier. Bound and free occurrences of variables.

Scope of (an occurrence of) a quantifier Q in a given formula A (where Q ∈ {∀, ∃}) is the unique subformula QxB beginning with that

  • ccurrence of the quantifier Q in A.

Some examples of scopes of quantifiers: ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))).

slide-12
SLIDE 12

Goranko

Scope of a quantifier. Bound and free occurrences of variables.

Scope of (an occurrence of) a quantifier Q in a given formula A (where Q ∈ {∀, ∃}) is the unique subformula QxB beginning with that

  • ccurrence of the quantifier Q in A.

Some examples of scopes of quantifiers: ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))).

slide-13
SLIDE 13

Goranko

Scope of a quantifier. Bound and free occurrences of variables.

Scope of (an occurrence of) a quantifier Q in a given formula A (where Q ∈ {∀, ∃}) is the unique subformula QxB beginning with that

  • ccurrence of the quantifier Q in A.

Some examples of scopes of quantifiers: ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). An occurrence of the quantifier Q followed by a variable x in a formula A is said to bind the variable x in A.

slide-14
SLIDE 14

Goranko

Scope of a quantifier. Bound and free occurrences of variables.

Scope of (an occurrence of) a quantifier Q in a given formula A (where Q ∈ {∀, ∃}) is the unique subformula QxB beginning with that

  • ccurrence of the quantifier Q in A.

Some examples of scopes of quantifiers: ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). An occurrence of the quantifier Q followed by a variable x in a formula A is said to bind the variable x in A. An occurrence of a variable x in a formula A is bound if it is in the scope

  • f an occurrence of a quantifier Q binding x in A.
slide-15
SLIDE 15

Goranko

Scope of a quantifier. Bound and free occurrences of variables.

Scope of (an occurrence of) a quantifier Q in a given formula A (where Q ∈ {∀, ∃}) is the unique subformula QxB beginning with that

  • ccurrence of the quantifier Q in A.

Some examples of scopes of quantifiers: ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))). An occurrence of the quantifier Q followed by a variable x in a formula A is said to bind the variable x in A. An occurrence of a variable x in a formula A is bound if it is in the scope

  • f an occurrence of a quantifier Q binding x in A.

Otherwise, that occurrence of x is free in A.

slide-16
SLIDE 16

Goranko

Which quantifiers binds which occurrences of variables?

slide-17
SLIDE 17

Goranko

Which quantifiers binds which occurrences of variables?

A bound occurrence of a variable x in a given formula A is bound by the innermost occurrence of a quantifier Qx in A, in the scope of which it

  • ccurs.
slide-18
SLIDE 18

Goranko

Which quantifiers binds which occurrences of variables?

A bound occurrence of a variable x in a given formula A is bound by the innermost occurrence of a quantifier Qx in A, in the scope of which it

  • ccurs.

For example, the first occurrence of ∀ in the following formula binds the first 3 occurrences of x: ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))),

slide-19
SLIDE 19

Goranko

Which quantifiers binds which occurrences of variables?

A bound occurrence of a variable x in a given formula A is bound by the innermost occurrence of a quantifier Qx in A, in the scope of which it

  • ccurs.

For example, the first occurrence of ∀ in the following formula binds the first 3 occurrences of x: ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))), whereas the occurrence of ∃ binds the last 2 occurrences of x: ∀x((x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3)))).

slide-20
SLIDE 20

Goranko

Bound and free variables in a formula

slide-21
SLIDE 21

Goranko

Bound and free variables in a formula

A variable x is bound in the formula A if it has at least one bound

  • ccurrence in A.
slide-22
SLIDE 22

Goranko

Bound and free variables in a formula

A variable x is bound in the formula A if it has at least one bound

  • ccurrence in A. Then x is said to be a bound variable of A.
slide-23
SLIDE 23

Goranko

Bound and free variables in a formula

A variable x is bound in the formula A if it has at least one bound

  • ccurrence in A. Then x is said to be a bound variable of A.

A variable x is free in the formula A if it has at least one free occurrence in A.

slide-24
SLIDE 24

Goranko

Bound and free variables in a formula

A variable x is bound in the formula A if it has at least one bound

  • ccurrence in A. Then x is said to be a bound variable of A.

A variable x is free in the formula A if it has at least one free occurrence in A. Then x is said to be a free variable of A.

slide-25
SLIDE 25

Goranko

Bound and free variables in a formula

A variable x is bound in the formula A if it has at least one bound

  • ccurrence in A. Then x is said to be a bound variable of A.

A variable x is free in the formula A if it has at least one free occurrence in A. Then x is said to be a free variable of A. For instance, in the formula A = (x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3))). the first two occurrences of x are free, while all other occurrences of variables are bound. Thus, the only free variable in A is x, while both x and y are bound in A.

slide-26
SLIDE 26

Goranko

Bound and free variables in a formula

A variable x is bound in the formula A if it has at least one bound

  • ccurrence in A. Then x is said to be a bound variable of A.

A variable x is free in the formula A if it has at least one free occurrence in A. Then x is said to be a free variable of A. For instance, in the formula A = (x > 5) → ∀y(y < 5 → (y < x ∧ ∃x(x < 3))). the first two occurrences of x are free, while all other occurrences of variables are bound. Thus, the only free variable in A is x, while both x and y are bound in A. Note that the same variable can be both free and bound in the same formula.

slide-27
SLIDE 27

Goranko

The sets of bound and free variables in a formula

slide-28
SLIDE 28

Goranko

The sets of bound and free variables in a formula

Definition (The set of free variables in a formula)

Let L be any first-order language. The mapping FVAR : FOR(L) → P(VAR) (where P(VAR) is the powerset of VAR) is defined recursively on the structure of formulae in L as follows.

slide-29
SLIDE 29

Goranko

The sets of bound and free variables in a formula

Definition (The set of free variables in a formula)

Let L be any first-order language. The mapping FVAR : FOR(L) → P(VAR) (where P(VAR) is the powerset of VAR) is defined recursively on the structure of formulae in L as follows.

  • 1. For every atomic formula A = p(t1, ..., tn),

FVAR(A) := VAR(t1) ∪ . . . ∪ VAR(tn).

slide-30
SLIDE 30

Goranko

The sets of bound and free variables in a formula

Definition (The set of free variables in a formula)

Let L be any first-order language. The mapping FVAR : FOR(L) → P(VAR) (where P(VAR) is the powerset of VAR) is defined recursively on the structure of formulae in L as follows.

  • 1. For every atomic formula A = p(t1, ..., tn),

FVAR(A) := VAR(t1) ∪ . . . ∪ VAR(tn).

  • 2. If A is a formula in L then FVAR(¬A) := FVAR(A).
slide-31
SLIDE 31

Goranko

The sets of bound and free variables in a formula

Definition (The set of free variables in a formula)

Let L be any first-order language. The mapping FVAR : FOR(L) → P(VAR) (where P(VAR) is the powerset of VAR) is defined recursively on the structure of formulae in L as follows.

  • 1. For every atomic formula A = p(t1, ..., tn),

FVAR(A) := VAR(t1) ∪ . . . ∪ VAR(tn).

  • 2. If A is a formula in L then FVAR(¬A) := FVAR(A).
  • 3. If A and B are formulae in L and • ∈ {∧, ∨, →, ↔} then

FVAR(A • B) := FVAR(A) ∪ FVAR(B)

slide-32
SLIDE 32

Goranko

The sets of bound and free variables in a formula

Definition (The set of free variables in a formula)

Let L be any first-order language. The mapping FVAR : FOR(L) → P(VAR) (where P(VAR) is the powerset of VAR) is defined recursively on the structure of formulae in L as follows.

  • 1. For every atomic formula A = p(t1, ..., tn),

FVAR(A) := VAR(t1) ∪ . . . ∪ VAR(tn).

  • 2. If A is a formula in L then FVAR(¬A) := FVAR(A).
  • 3. If A and B are formulae in L and • ∈ {∧, ∨, →, ↔} then

FVAR(A • B) := FVAR(A) ∪ FVAR(B)

  • 4. If A is a formula in L and x is an individual variable, then

FVAR(∀xA) = FVAR(∃xA) = FVAR(A) \ {x} .

slide-33
SLIDE 33

Goranko

The sets of bound and free variables in a formula

Definition (The set of free variables in a formula)

Let L be any first-order language. The mapping FVAR : FOR(L) → P(VAR) (where P(VAR) is the powerset of VAR) is defined recursively on the structure of formulae in L as follows.

  • 1. For every atomic formula A = p(t1, ..., tn),

FVAR(A) := VAR(t1) ∪ . . . ∪ VAR(tn).

  • 2. If A is a formula in L then FVAR(¬A) := FVAR(A).
  • 3. If A and B are formulae in L and • ∈ {∧, ∨, →, ↔} then

FVAR(A • B) := FVAR(A) ∪ FVAR(B)

  • 4. If A is a formula in L and x is an individual variable, then

FVAR(∀xA) = FVAR(∃xA) = FVAR(A) \ {x} . Exercise: define similarly the set of bound variables BVAR(A) for every formula A.

slide-34
SLIDE 34

Goranko

Open and closed formulae

slide-35
SLIDE 35

Goranko

Open and closed formulae

Theorem

The truth of a formula A in a given structure S only depends on the assignment of values to the free variables occurring in A.

slide-36
SLIDE 36

Goranko

Open and closed formulae

Theorem

The truth of a formula A in a given structure S only depends on the assignment of values to the free variables occurring in A. That is, if v1, v2 are variable assignments in S such that v1 |FVAR(A)= v2 |FVAR(A), then S, v1 | = A iff S, v2 | = A.

slide-37
SLIDE 37

Goranko

Open and closed formulae

Theorem

The truth of a formula A in a given structure S only depends on the assignment of values to the free variables occurring in A. That is, if v1, v2 are variable assignments in S such that v1 |FVAR(A)= v2 |FVAR(A), then S, v1 | = A iff S, v2 | = A. Proof: by structural induction of formulae, using the recursive definition

  • f FVAR(A). Exercise.
slide-38
SLIDE 38

Goranko

Open and closed formulae

Theorem

The truth of a formula A in a given structure S only depends on the assignment of values to the free variables occurring in A. That is, if v1, v2 are variable assignments in S such that v1 |FVAR(A)= v2 |FVAR(A), then S, v1 | = A iff S, v2 | = A. Proof: by structural induction of formulae, using the recursive definition

  • f FVAR(A). Exercise.

An open formula is a formula with no bound variables, i.e. not containing any occurrences of quantifiers.

slide-39
SLIDE 39

Goranko

Open and closed formulae

Theorem

The truth of a formula A in a given structure S only depends on the assignment of values to the free variables occurring in A. That is, if v1, v2 are variable assignments in S such that v1 |FVAR(A)= v2 |FVAR(A), then S, v1 | = A iff S, v2 | = A. Proof: by structural induction of formulae, using the recursive definition

  • f FVAR(A). Exercise.

An open formula is a formula with no bound variables, i.e. not containing any occurrences of quantifiers. A closed formula, or a sentence is a formula with no free variables.

slide-40
SLIDE 40

Goranko

Open and closed formulae

Theorem

The truth of a formula A in a given structure S only depends on the assignment of values to the free variables occurring in A. That is, if v1, v2 are variable assignments in S such that v1 |FVAR(A)= v2 |FVAR(A), then S, v1 | = A iff S, v2 | = A. Proof: by structural induction of formulae, using the recursive definition

  • f FVAR(A). Exercise.

An open formula is a formula with no bound variables, i.e. not containing any occurrences of quantifiers. A closed formula, or a sentence is a formula with no free variables. Thus, the truth of a sentence in a structure does not depend on the variable assignment.

slide-41
SLIDE 41

Goranko

Using bound and free variables in a formula

slide-42
SLIDE 42

Goranko

Using bound and free variables in a formula

Free variables have their own values in a given formula (determined by a variable assignment)

slide-43
SLIDE 43

Goranko

Using bound and free variables in a formula

Free variables have their own values in a given formula (determined by a variable assignment), while bound variables only play a dummy role and can be replaced (with care!) by one another.

slide-44
SLIDE 44

Goranko

Using bound and free variables in a formula

Free variables have their own values in a given formula (determined by a variable assignment), while bound variables only play a dummy role and can be replaced (with care!) by one another. For instance, the sentence ∃x(5 < x ∧ x2 + x − 2 = 0) means exactly the same as ∃y(5 < y ∧ y2 + y − 2 = 0), in the sense that both formulae always have the same truth value.

slide-45
SLIDE 45

Goranko

Using bound and free variables in a formula

Free variables have their own values in a given formula (determined by a variable assignment), while bound variables only play a dummy role and can be replaced (with care!) by one another. For instance, the sentence ∃x(5 < x ∧ x2 + x − 2 = 0) means exactly the same as ∃y(5 < y ∧ y2 + y − 2 = 0), in the sense that both formulae always have the same truth value. Likewise, ∀x(5 < x ∨ x2 + x − 2 = 0) means the same as ∀y(5 < y ∨ y2 + y − 2 = 0).

slide-46
SLIDE 46

Goranko

Using bound and free variables in a formula

Free variables have their own values in a given formula (determined by a variable assignment), while bound variables only play a dummy role and can be replaced (with care!) by one another. For instance, the sentence ∃x(5 < x ∧ x2 + x − 2 = 0) means exactly the same as ∃y(5 < y ∧ y2 + y − 2 = 0), in the sense that both formulae always have the same truth value. Likewise, ∀x(5 < x ∨ x2 + x − 2 = 0) means the same as ∀y(5 < y ∨ y2 + y − 2 = 0). On the other hand, the meaning of 5 < x ∧ x2 + x − 2 = 0 is essentially different from the meaning of 5 < y ∧ y2 + y − 2 = 0.

slide-47
SLIDE 47

Goranko

Using bound and free variables in a formula

Free variables have their own values in a given formula (determined by a variable assignment), while bound variables only play a dummy role and can be replaced (with care!) by one another. For instance, the sentence ∃x(5 < x ∧ x2 + x − 2 = 0) means exactly the same as ∃y(5 < y ∧ y2 + y − 2 = 0), in the sense that both formulae always have the same truth value. Likewise, ∀x(5 < x ∨ x2 + x − 2 = 0) means the same as ∀y(5 < y ∨ y2 + y − 2 = 0). On the other hand, the meaning of 5 < x ∧ x2 + x − 2 = 0 is essentially different from the meaning of 5 < y ∧ y2 + y − 2 = 0. Both formulae state the same, but about different individuals.

slide-48
SLIDE 48

Goranko

Reusing variables as free and bound in a formula

slide-49
SLIDE 49

Goranko

Reusing variables as free and bound in a formula

The same variable can occur both free and bound in a formula: x > 5 → ∀x(2x > x).

slide-50
SLIDE 50

Goranko

Reusing variables as free and bound in a formula

The same variable can occur both free and bound in a formula: x > 5 → ∀x(2x > x). However, the free occurrence of x is unrelated to the bound occurrences

  • f x:

x > 5 → ∀x(2x > x).

slide-51
SLIDE 51

Goranko

Reusing variables as free and bound in a formula

The same variable can occur both free and bound in a formula: x > 5 → ∀x(2x > x). However, the free occurrence of x is unrelated to the bound occurrences

  • f x:

x > 5 → ∀x(2x > x). Thus, the formula above has the same meaning as x > 5 → ∀y(2y > y),

slide-52
SLIDE 52

Goranko

Reusing variables as free and bound in a formula

The same variable can occur both free and bound in a formula: x > 5 → ∀x(2x > x). However, the free occurrence of x is unrelated to the bound occurrences

  • f x:

x > 5 → ∀x(2x > x). Thus, the formula above has the same meaning as x > 5 → ∀y(2y > y), but not the same meaning as y > 5 → ∀x(2x > x).

slide-53
SLIDE 53

Goranko

Binding a variable by different quantifiers in a formula

slide-54
SLIDE 54

Goranko

Binding a variable by different quantifiers in a formula

Different occurrences of the same variable can be bound by different quantifiers: ∃x(x > 5) ∨ ∀x(2x > x).

slide-55
SLIDE 55

Goranko

Binding a variable by different quantifiers in a formula

Different occurrences of the same variable can be bound by different quantifiers: ∃x(x > 5) ∨ ∀x(2x > x). Again, the occurrences of x, bound by the first quantifier, have nothing to do with those bound by the second one.

slide-56
SLIDE 56

Goranko

Binding a variable by different quantifiers in a formula

Different occurrences of the same variable can be bound by different quantifiers: ∃x(x > 5) ∨ ∀x(2x > x). Again, the occurrences of x, bound by the first quantifier, have nothing to do with those bound by the second one. For instance, the two x’s claimed to exist in the formula ∃x(x > 5) ∧ ∃x(x < 3). need not (and, in fact, cannot) be the same.

slide-57
SLIDE 57

Goranko

Binding a variable by different quantifiers in a formula

Different occurrences of the same variable can be bound by different quantifiers: ∃x(x > 5) ∨ ∀x(2x > x). Again, the occurrences of x, bound by the first quantifier, have nothing to do with those bound by the second one. For instance, the two x’s claimed to exist in the formula ∃x(x > 5) ∧ ∃x(x < 3). need not (and, in fact, cannot) be the same. Thus, the formula above has the same meaning as each of ∃y(y > 5) ∧ ∃x(x < 3),

slide-58
SLIDE 58

Goranko

Binding a variable by different quantifiers in a formula

Different occurrences of the same variable can be bound by different quantifiers: ∃x(x > 5) ∨ ∀x(2x > x). Again, the occurrences of x, bound by the first quantifier, have nothing to do with those bound by the second one. For instance, the two x’s claimed to exist in the formula ∃x(x > 5) ∧ ∃x(x < 3). need not (and, in fact, cannot) be the same. Thus, the formula above has the same meaning as each of ∃y(y > 5) ∧ ∃x(x < 3), ∃x(x > 5) ∧ ∃z(z < 3),

slide-59
SLIDE 59

Goranko

Binding a variable by different quantifiers in a formula

Different occurrences of the same variable can be bound by different quantifiers: ∃x(x > 5) ∨ ∀x(2x > x). Again, the occurrences of x, bound by the first quantifier, have nothing to do with those bound by the second one. For instance, the two x’s claimed to exist in the formula ∃x(x > 5) ∧ ∃x(x < 3). need not (and, in fact, cannot) be the same. Thus, the formula above has the same meaning as each of ∃y(y > 5) ∧ ∃x(x < 3), ∃x(x > 5) ∧ ∃z(z < 3), ∃y(y > 5) ∧ ∃z(z < 3).

slide-60
SLIDE 60

Goranko

Nested bindings of a variable in a formula

slide-61
SLIDE 61

Goranko

Nested bindings of a variable in a formula

Different bindings of the same variable can be nested, e.g.: ∀x(x > 5 → ∃x(x < 3)).

slide-62
SLIDE 62

Goranko

Nested bindings of a variable in a formula

Different bindings of the same variable can be nested, e.g.: ∀x(x > 5 → ∃x(x < 3)). Again, the occurrences of x in the subformula ∃x(x < 3) are bound by ∃ and not related to the first two occurrences of x, bound by ∀: ∀x(x > 5 → ∃x(x < 3)).

slide-63
SLIDE 63

Goranko

Nested bindings of a variable in a formula

Different bindings of the same variable can be nested, e.g.: ∀x(x > 5 → ∃x(x < 3)). Again, the occurrences of x in the subformula ∃x(x < 3) are bound by ∃ and not related to the first two occurrences of x, bound by ∀: ∀x(x > 5 → ∃x(x < 3)). Thus, the formula above has the same meaning as each of ∀x(x > 5 → ∃y(y < 3)),

slide-64
SLIDE 64

Goranko

Nested bindings of a variable in a formula

Different bindings of the same variable can be nested, e.g.: ∀x(x > 5 → ∃x(x < 3)). Again, the occurrences of x in the subformula ∃x(x < 3) are bound by ∃ and not related to the first two occurrences of x, bound by ∀: ∀x(x > 5 → ∃x(x < 3)). Thus, the formula above has the same meaning as each of ∀x(x > 5 → ∃y(y < 3)), ∀z(z > 5 → ∃x(x < 3)),

slide-65
SLIDE 65

Goranko

Nested bindings of a variable in a formula

Different bindings of the same variable can be nested, e.g.: ∀x(x > 5 → ∃x(x < 3)). Again, the occurrences of x in the subformula ∃x(x < 3) are bound by ∃ and not related to the first two occurrences of x, bound by ∀: ∀x(x > 5 → ∃x(x < 3)). Thus, the formula above has the same meaning as each of ∀x(x > 5 → ∃y(y < 3)), ∀z(z > 5 → ∃x(x < 3)), ∀z(z > 5 → ∃y(y < 3)).

slide-66
SLIDE 66

Goranko

Renaming of a bound variable in a formula

slide-67
SLIDE 67

Goranko

Renaming of a bound variable in a formula

Using the same variable for different purposes in a formula can be confusing, and is often unwanted, so we may want to eliminate it.

slide-68
SLIDE 68

Goranko

Renaming of a bound variable in a formula

Using the same variable for different purposes in a formula can be confusing, and is often unwanted, so we may want to eliminate it. Renaming of the variable x in a formula A is the substitution of all

  • ccurrences of x bound by the same occurrence of a quantifier in A with

another variable, not occurring in A.

slide-69
SLIDE 69

Goranko

Renaming of a bound variable in a formula

Using the same variable for different purposes in a formula can be confusing, and is often unwanted, so we may want to eliminate it. Renaming of the variable x in a formula A is the substitution of all

  • ccurrences of x bound by the same occurrence of a quantifier in A with

another variable, not occurring in A. E.g., a possible renaming of (x > 5) ∧ ∀x(x > 5 → ¬∃x(x < y))

slide-70
SLIDE 70

Goranko

Renaming of a bound variable in a formula

Using the same variable for different purposes in a formula can be confusing, and is often unwanted, so we may want to eliminate it. Renaming of the variable x in a formula A is the substitution of all

  • ccurrences of x bound by the same occurrence of a quantifier in A with

another variable, not occurring in A. E.g., a possible renaming of (x > 5) ∧ ∀x(x > 5 → ¬∃x(x < y)) is the formula (x > 5) ∧ ∀x(x > 5 → ¬∃z(z < y))

slide-71
SLIDE 71

Goranko

Renaming of a bound variable in a formula

Using the same variable for different purposes in a formula can be confusing, and is often unwanted, so we may want to eliminate it. Renaming of the variable x in a formula A is the substitution of all

  • ccurrences of x bound by the same occurrence of a quantifier in A with

another variable, not occurring in A. E.g., a possible renaming of (x > 5) ∧ ∀x(x > 5 → ¬∃x(x < y)) is the formula (x > 5) ∧ ∀x(x > 5 → ¬∃z(z < y)) However, neither of the following formulae is a correct renaming:

slide-72
SLIDE 72

Goranko

Renaming of a bound variable in a formula

Using the same variable for different purposes in a formula can be confusing, and is often unwanted, so we may want to eliminate it. Renaming of the variable x in a formula A is the substitution of all

  • ccurrences of x bound by the same occurrence of a quantifier in A with

another variable, not occurring in A. E.g., a possible renaming of (x > 5) ∧ ∀x(x > 5 → ¬∃x(x < y)) is the formula (x > 5) ∧ ∀x(x > 5 → ¬∃z(z < y)) However, neither of the following formulae is a correct renaming: (z > 5) ∧ ∀x((x > 5) → ¬∃x(x < y)),

slide-73
SLIDE 73

Goranko

Renaming of a bound variable in a formula

Using the same variable for different purposes in a formula can be confusing, and is often unwanted, so we may want to eliminate it. Renaming of the variable x in a formula A is the substitution of all

  • ccurrences of x bound by the same occurrence of a quantifier in A with

another variable, not occurring in A. E.g., a possible renaming of (x > 5) ∧ ∀x(x > 5 → ¬∃x(x < y)) is the formula (x > 5) ∧ ∀x(x > 5 → ¬∃z(z < y)) However, neither of the following formulae is a correct renaming: (z > 5) ∧ ∀x((x > 5) → ¬∃x(x < y)), (x > 5) ∧ ∀z((z > 5) → ¬∃z(z < y)),

slide-74
SLIDE 74

Goranko

Renaming of a bound variable in a formula

Using the same variable for different purposes in a formula can be confusing, and is often unwanted, so we may want to eliminate it. Renaming of the variable x in a formula A is the substitution of all

  • ccurrences of x bound by the same occurrence of a quantifier in A with

another variable, not occurring in A. E.g., a possible renaming of (x > 5) ∧ ∀x(x > 5 → ¬∃x(x < y)) is the formula (x > 5) ∧ ∀x(x > 5 → ¬∃z(z < y)) However, neither of the following formulae is a correct renaming: (z > 5) ∧ ∀x((x > 5) → ¬∃x(x < y)), (x > 5) ∧ ∀z((z > 5) → ¬∃z(z < y)), (x > 5) ∧ ∀x(x > 5 → ¬∃y(y < y)).

slide-75
SLIDE 75

Goranko

Renaming of a bound variable in a formula

Using the same variable for different purposes in a formula can be confusing, and is often unwanted, so we may want to eliminate it. Renaming of the variable x in a formula A is the substitution of all

  • ccurrences of x bound by the same occurrence of a quantifier in A with

another variable, not occurring in A. E.g., a possible renaming of (x > 5) ∧ ∀x(x > 5 → ¬∃x(x < y)) is the formula (x > 5) ∧ ∀x(x > 5 → ¬∃z(z < y)) However, neither of the following formulae is a correct renaming: (z > 5) ∧ ∀x((x > 5) → ¬∃x(x < y)), (x > 5) ∧ ∀z((z > 5) → ¬∃z(z < y)), (x > 5) ∧ ∀x(x > 5 → ¬∃y(y < y)). Claim: The result of renaming a variable in a formula A always has the same truth value as A

slide-76
SLIDE 76

Goranko

Renaming of a bound variable in a formula

Using the same variable for different purposes in a formula can be confusing, and is often unwanted, so we may want to eliminate it. Renaming of the variable x in a formula A is the substitution of all

  • ccurrences of x bound by the same occurrence of a quantifier in A with

another variable, not occurring in A. E.g., a possible renaming of (x > 5) ∧ ∀x(x > 5 → ¬∃x(x < y)) is the formula (x > 5) ∧ ∀x(x > 5 → ¬∃z(z < y)) However, neither of the following formulae is a correct renaming: (z > 5) ∧ ∀x((x > 5) → ¬∃x(x < y)), (x > 5) ∧ ∀z((z > 5) → ¬∃z(z < y)), (x > 5) ∧ ∀x(x > 5 → ¬∃y(y < y)). Claim: The result of renaming a variable in a formula A always has the same truth value as A, so it is logically equivalent to A.

slide-77
SLIDE 77

Goranko

Clean formulae

slide-78
SLIDE 78

Goranko

Clean formulae

A formula A is clean if no variable occurs both free and bound in A and every two occurrences of quantifiers bind different variables.

slide-79
SLIDE 79

Goranko

Clean formulae

A formula A is clean if no variable occurs both free and bound in A and every two occurrences of quantifiers bind different variables. Thus, ∃x(x > 5) ∧ ∃y(y < z) is clean,

slide-80
SLIDE 80

Goranko

Clean formulae

A formula A is clean if no variable occurs both free and bound in A and every two occurrences of quantifiers bind different variables. Thus, ∃x(x > 5) ∧ ∃y(y < z) is clean, while ∃x(x > 5) ∧ ∃y(y < x)

slide-81
SLIDE 81

Goranko

Clean formulae

A formula A is clean if no variable occurs both free and bound in A and every two occurrences of quantifiers bind different variables. Thus, ∃x(x > 5) ∧ ∃y(y < z) is clean, while ∃x(x > 5) ∧ ∃y(y < x) and ∃x(x > 5) ∧ ∃x(y < x) are not.

slide-82
SLIDE 82

Goranko

Clean formulae

A formula A is clean if no variable occurs both free and bound in A and every two occurrences of quantifiers bind different variables. Thus, ∃x(x > 5) ∧ ∃y(y < z) is clean, while ∃x(x > 5) ∧ ∃y(y < x) and ∃x(x > 5) ∧ ∃x(y < x) are not. Claim: Every formula can be transformed into a clean formula by means of several consecutive renamings of variables.

slide-83
SLIDE 83

Goranko

Clean formulae

A formula A is clean if no variable occurs both free and bound in A and every two occurrences of quantifiers bind different variables. Thus, ∃x(x > 5) ∧ ∃y(y < z) is clean, while ∃x(x > 5) ∧ ∃y(y < x) and ∃x(x > 5) ∧ ∃x(y < x) are not. Claim: Every formula can be transformed into a clean formula by means of several consecutive renamings of variables. E.g., (x > 5) ∧ ∀x((x > 5) → ¬∃x(x < y))

slide-84
SLIDE 84

Goranko

Clean formulae

A formula A is clean if no variable occurs both free and bound in A and every two occurrences of quantifiers bind different variables. Thus, ∃x(x > 5) ∧ ∃y(y < z) is clean, while ∃x(x > 5) ∧ ∃y(y < x) and ∃x(x > 5) ∧ ∃x(y < x) are not. Claim: Every formula can be transformed into a clean formula by means of several consecutive renamings of variables. E.g., (x > 5) ∧ ∀x((x > 5) → ¬∃x(x < y)) can be transformed into a clean formula as follows:

slide-85
SLIDE 85

Goranko

Clean formulae

A formula A is clean if no variable occurs both free and bound in A and every two occurrences of quantifiers bind different variables. Thus, ∃x(x > 5) ∧ ∃y(y < z) is clean, while ∃x(x > 5) ∧ ∃y(y < x) and ∃x(x > 5) ∧ ∃x(y < x) are not. Claim: Every formula can be transformed into a clean formula by means of several consecutive renamings of variables. E.g., (x > 5) ∧ ∀x((x > 5) → ¬∃x(x < y)) can be transformed into a clean formula as follows: (x > 5) ∧ ∀x1((x1 > 5) → ¬∃x(x < y)),

slide-86
SLIDE 86

Goranko

Clean formulae

A formula A is clean if no variable occurs both free and bound in A and every two occurrences of quantifiers bind different variables. Thus, ∃x(x > 5) ∧ ∃y(y < z) is clean, while ∃x(x > 5) ∧ ∃y(y < x) and ∃x(x > 5) ∧ ∃x(y < x) are not. Claim: Every formula can be transformed into a clean formula by means of several consecutive renamings of variables. E.g., (x > 5) ∧ ∀x((x > 5) → ¬∃x(x < y)) can be transformed into a clean formula as follows: (x > 5) ∧ ∀x1((x1 > 5) → ¬∃x(x < y)), (x > 5) ∧ ∀x1((x1 > 5) → ¬∃x2(x2 < y)).

slide-87
SLIDE 87

Goranko

Substitution of a term for a variable in a formula

slide-88
SLIDE 88

Goranko

Substitution of a term for a variable in a formula

Unform substitution of a term t for a variable x in a formula A means that all free occurrences x in A are simultaneously replaced by t. The result of the substitution is denoted A[t/x].

slide-89
SLIDE 89

Goranko

Substitution of a term for a variable in a formula

Unform substitution of a term t for a variable x in a formula A means that all free occurrences x in A are simultaneously replaced by t. The result of the substitution is denoted A[t/x]. Example: given the formula A = ∀x(P(x, y) → (¬Q(y) ∨ ∃yP(x, y)))

slide-90
SLIDE 90

Goranko

Substitution of a term for a variable in a formula

Unform substitution of a term t for a variable x in a formula A means that all free occurrences x in A are simultaneously replaced by t. The result of the substitution is denoted A[t/x]. Example: given the formula A = ∀x(P(x, y) → (¬Q(y) ∨ ∃yP(x, y))) we have A[f (y, z)/y] = ∀x(P(x, f (y, z)) → (¬Q(f (y, z)) ∨ ∃yP(x, y))),

slide-91
SLIDE 91

Goranko

Substitution of a term for a variable in a formula

Unform substitution of a term t for a variable x in a formula A means that all free occurrences x in A are simultaneously replaced by t. The result of the substitution is denoted A[t/x]. Example: given the formula A = ∀x(P(x, y) → (¬Q(y) ∨ ∃yP(x, y))) we have A[f (y, z)/y] = ∀x(P(x, f (y, z)) → (¬Q(f (y, z)) ∨ ∃yP(x, y))), while A[f (y, z)/x] = A because x does not occur free in A.

slide-92
SLIDE 92

Goranko

Substitution of a term for a variable in a formula

Unform substitution of a term t for a variable x in a formula A means that all free occurrences x in A are simultaneously replaced by t. The result of the substitution is denoted A[t/x]. Example: given the formula A = ∀x(P(x, y) → (¬Q(y) ∨ ∃yP(x, y))) we have A[f (y, z)/y] = ∀x(P(x, f (y, z)) → (¬Q(f (y, z)) ∨ ∃yP(x, y))), while A[f (y, z)/x] = A because x does not occur free in A. Intuitively, A[t/x] is supposed to say about the individual denoted by t the same as what A says about the individual denoted by x.

slide-93
SLIDE 93

Goranko

Substitution of a term for a variable in a formula

Unform substitution of a term t for a variable x in a formula A means that all free occurrences x in A are simultaneously replaced by t. The result of the substitution is denoted A[t/x]. Example: given the formula A = ∀x(P(x, y) → (¬Q(y) ∨ ∃yP(x, y))) we have A[f (y, z)/y] = ∀x(P(x, f (y, z)) → (¬Q(f (y, z)) ∨ ∃yP(x, y))), while A[f (y, z)/x] = A because x does not occur free in A. Intuitively, A[t/x] is supposed to say about the individual denoted by t the same as what A says about the individual denoted by x. Question: is that always the case?

slide-94
SLIDE 94

Goranko

Substitution of a term for a variable in a formula

Unform substitution of a term t for a variable x in a formula A means that all free occurrences x in A are simultaneously replaced by t. The result of the substitution is denoted A[t/x]. Example: given the formula A = ∀x(P(x, y) → (¬Q(y) ∨ ∃yP(x, y))) we have A[f (y, z)/y] = ∀x(P(x, f (y, z)) → (¬Q(f (y, z)) ∨ ∃yP(x, y))), while A[f (y, z)/x] = A because x does not occur free in A. Intuitively, A[t/x] is supposed to say about the individual denoted by t the same as what A says about the individual denoted by x. Question: is that always the case? Is a substitution of a term for a formula always ’safe’?

slide-95
SLIDE 95

Goranko

Capture of a variable in substitution

slide-96
SLIDE 96

Goranko

Capture of a variable in substitution

The formula A = ∃y(x < y) is true in N for any value of x.

slide-97
SLIDE 97

Goranko

Capture of a variable in substitution

The formula A = ∃y(x < y) is true in N for any value of x. However, A[(y + 1)/x] = ∃y(y + 1 < y), which is false in N.

slide-98
SLIDE 98

Goranko

Capture of a variable in substitution

The formula A = ∃y(x < y) is true in N for any value of x. However, A[(y + 1)/x] = ∃y(y + 1 < y), which is false in N. Therefore, the formula A[(y + 1)/x] does not say about the term y + 1 the same as what A says about x.

slide-99
SLIDE 99

Goranko

Capture of a variable in substitution

The formula A = ∃y(x < y) is true in N for any value of x. However, A[(y + 1)/x] = ∃y(y + 1 < y), which is false in N. Therefore, the formula A[(y + 1)/x] does not say about the term y + 1 the same as what A says about x. What went wrong?

slide-100
SLIDE 100

Goranko

Capture of a variable in substitution

The formula A = ∃y(x < y) is true in N for any value of x. However, A[(y + 1)/x] = ∃y(y + 1 < y), which is false in N. Therefore, the formula A[(y + 1)/x] does not say about the term y + 1 the same as what A says about x. What went wrong? The occurrence of y in the term y + 1 got captured by the quantifier ∃y, because we mixed the free and the bound uses of y.

slide-101
SLIDE 101

Goranko

Capture of a variable in substitution

The formula A = ∃y(x < y) is true in N for any value of x. However, A[(y + 1)/x] = ∃y(y + 1 < y), which is false in N. Therefore, the formula A[(y + 1)/x] does not say about the term y + 1 the same as what A says about x. What went wrong? The occurrence of y in the term y + 1 got captured by the quantifier ∃y, because we mixed the free and the bound uses of y. Capture: when new occurrences of a variable y are introduced in the scope of a quantifier Qy occurring in the formula A as a result of substitution of a term t containing y for another variable x in A.

slide-102
SLIDE 102

Goranko

Terms free for substitution for a variable in a formula

slide-103
SLIDE 103

Goranko

Terms free for substitution for a variable in a formula

A term t is free for (substitution for) a variable x in a formula A, if no variable in t is captured by a quantifier when t is substituted for x in A.

slide-104
SLIDE 104

Goranko

Terms free for substitution for a variable in a formula

A term t is free for (substitution for) a variable x in a formula A, if no variable in t is captured by a quantifier when t is substituted for x in A. Examples:

slide-105
SLIDE 105

Goranko

Terms free for substitution for a variable in a formula

A term t is free for (substitution for) a variable x in a formula A, if no variable in t is captured by a quantifier when t is substituted for x in A. Examples: The term f (x, y) is free for substitution for y in the formula A = ∀x(P(x, z) ∧ ∃yQ(y)) → P(y, z),

slide-106
SLIDE 106

Goranko

Terms free for substitution for a variable in a formula

A term t is free for (substitution for) a variable x in a formula A, if no variable in t is captured by a quantifier when t is substituted for x in A. Examples: The term f (x, y) is free for substitution for y in the formula A = ∀x(P(x, z) ∧ ∃yQ(y)) → P(y, z), resulting in A[f (x, y)/y] = ∀x(P(x, z) ∧ ∃yQ(y)) → P(f (x, y), z),

slide-107
SLIDE 107

Goranko

Terms free for substitution for a variable in a formula

A term t is free for (substitution for) a variable x in a formula A, if no variable in t is captured by a quantifier when t is substituted for x in A. Examples: The term f (x, y) is free for substitution for y in the formula A = ∀x(P(x, z) ∧ ∃yQ(y)) → P(y, z), resulting in A[f (x, y)/y] = ∀x(P(x, z) ∧ ∃yQ(y)) → P(f (x, y), z), but it is not free for substitution for z in A,

slide-108
SLIDE 108

Goranko

Terms free for substitution for a variable in a formula

A term t is free for (substitution for) a variable x in a formula A, if no variable in t is captured by a quantifier when t is substituted for x in A. Examples: The term f (x, y) is free for substitution for y in the formula A = ∀x(P(x, z) ∧ ∃yQ(y)) → P(y, z), resulting in A[f (x, y)/y] = ∀x(P(x, z) ∧ ∃yQ(y)) → P(f (x, y), z), but it is not free for substitution for z in A, resulting in A[f (x, y)/z] = ∀x(P(x, f (x, y)) ∧ ∃yQ(y)) → P(y, f (x, y)),

slide-109
SLIDE 109

Goranko

Terms free for substitution for a variable in a formula

A term t is free for (substitution for) a variable x in a formula A, if no variable in t is captured by a quantifier when t is substituted for x in A. Examples: The term f (x, y) is free for substitution for y in the formula A = ∀x(P(x, z) ∧ ∃yQ(y)) → P(y, z), resulting in A[f (x, y)/y] = ∀x(P(x, z) ∧ ∃yQ(y)) → P(f (x, y), z), but it is not free for substitution for z in A, resulting in A[f (x, y)/z] = ∀x(P(x, f (x, y)) ∧ ∃yQ(y)) → P(y, f (x, y)), because a capture occurs: A[f (x, y)/z] = ∀x(P(x, f (x, y)) ∧ ∃yQ(y)) → P(y, f (x, y)).

slide-110
SLIDE 110

Goranko

Terms free for substitution for a variable in a formula

A term t is free for (substitution for) a variable x in a formula A, if no variable in t is captured by a quantifier when t is substituted for x in A. Examples: The term f (x, y) is free for substitution for y in the formula A = ∀x(P(x, z) ∧ ∃yQ(y)) → P(y, z), resulting in A[f (x, y)/y] = ∀x(P(x, z) ∧ ∃yQ(y)) → P(f (x, y), z), but it is not free for substitution for z in A, resulting in A[f (x, y)/z] = ∀x(P(x, f (x, y)) ∧ ∃yQ(y)) → P(y, f (x, y)), because a capture occurs: A[f (x, y)/z] = ∀x(P(x, f (x, y)) ∧ ∃yQ(y)) → P(y, f (x, y)). Note that every ground term (not containing variables), in particular every constant symbol, is always free for substitution.

slide-111
SLIDE 111

Goranko

Renamings and substitutions in a formula

slide-112
SLIDE 112

Goranko

Renamings and substitutions in a formula

NB: renaming and substitution are different operations: – renaming always acts on bound variables, – whereas substitution always acts on free variables.

slide-113
SLIDE 113

Goranko

Renamings and substitutions in a formula

NB: renaming and substitution are different operations: – renaming always acts on bound variables, – whereas substitution always acts on free variables. Also, renamings preserve the formula up to logical equivalence, while substitutions do not.

slide-114
SLIDE 114

Goranko

Renamings and substitutions in a formula

NB: renaming and substitution are different operations: – renaming always acts on bound variables, – whereas substitution always acts on free variables. Also, renamings preserve the formula up to logical equivalence, while substitutions do not. On the other hand, a suitable renaming of a formula can prepare it for a substitution, by rendering the term, which is to be substituted, free for such substitution in the renamed formula.

slide-115
SLIDE 115

Goranko

Renamings and substitutions in a formula

NB: renaming and substitution are different operations: – renaming always acts on bound variables, – whereas substitution always acts on free variables. Also, renamings preserve the formula up to logical equivalence, while substitutions do not. On the other hand, a suitable renaming of a formula can prepare it for a substitution, by rendering the term, which is to be substituted, free for such substitution in the renamed formula. For instance, the term f (x, y) is not free for substitution for y in A = ∀x(P(x, y) ∧ ∃yQ(y)),

slide-116
SLIDE 116

Goranko

Renamings and substitutions in a formula

NB: renaming and substitution are different operations: – renaming always acts on bound variables, – whereas substitution always acts on free variables. Also, renamings preserve the formula up to logical equivalence, while substitutions do not. On the other hand, a suitable renaming of a formula can prepare it for a substitution, by rendering the term, which is to be substituted, free for such substitution in the renamed formula. For instance, the term f (x, y) is not free for substitution for y in A = ∀x(P(x, y) ∧ ∃yQ(y)), but it becomes free for such substitution after renaming of A to A′ = ∀x′(P(x′, y) ∧ ∃yQ(y)).