lmcs p 317 v 1 first order logic this is the most
play

(LMCS, p. 317) V.1 FirstOrder Logic This is the most powerful, - PDF document

(LMCS, p. 317) V.1 FirstOrder Logic This is the most powerful, most expressive logic that we will examine. Our version of first-order logic will use the following symbols: variables connectives ( , , , , )


  1. (LMCS, p. 317) V.1 First–Order Logic This is the most powerful, most expressive logic that we will examine. Our version of first-order logic will use the following symbols: • variables • connectives ( ∨ , ∧ , → , ↔ , ¬ ) • function symbols • relation symbols • constant symbols equality ( ≈ ) • quantifiers ( ∀ , ∃ ) •

  2. (LMCS, p. 318) V.2 Formulas for a first-order language L are defined inductively as follows: There are two kinds of atomic formulas: • ( s ≈ t ) , where and are terms, and s t ( rt 1 · · · t n ) , where is an n –ary relation r symbol and t 1 , · · · , t n are terms. • If F is a formula, then so is ( ¬ F ) . • If and G are formulas, then so are F ( F ∨ G ) , ( F ∧ G ) , ( F → G ) , ( F ↔ G ) . • If F is a formula and x is a variable, then ( ∀ x F ) and ( ∃ x F ) are formulas.

  3. (LMCS, p. 318) V.3 Notational Conventions • Drop outer parentheses • Adopt the previous precedence conventions for the propositional connectives. Quantifiers bind more strongly than any of • the connectives. Thus ∀ y ( rxy ) ∨ ∃ y ( rxy ) means ( ∀ y ( rxy )) ∨ ( ∃ y ( rxy )) .

  4. (LMCS, p. 318) V.4 The subformulas of a formula F : • The only subformula of an atomic formula F is F itself. The subformulas of ¬ F are itself • ¬ F and all the subformulas of F . • The subformulas of F � G are F � G itself and all the subformulas of F and all the subformulas of G . ( � is any of ∨ , ∧ , → , r ↔ ). • The subformulas of ∀ x F are ∀ x F itself and all the subformulas of F . The subformulas of ∃ x F are itself • ∃ x F and all the subformulas of F .

  5. (LMCS, p. 318-319) V.5 An occurrence of a variable in a formula x F is: • bound if the occurrence is in a subformula of the form ∀ x G or of the form ∃ x G (such a subformula is called the scope of the quantifier that begins the subformula). • Otherwise the occurrence of the variable is said to be free . • A formula with no free occurrences of variables is called a sentence .

  6. (LMCS, p. 318-319) V.6 Given a bound occurrence of in F , we say x that is bound by an occurrence of a x quantifier if Q (i) the occurrence of quantifies the Q variable x , and (ii) subject to this constraint the scope of this occurrence of is the smallest in which Q the given occurrence of occurs. x

  7. (LMCS, p. 319) V.7 It is easier to explain scope, and quantifiers that bind variables, with a diagram: An occurrence of the variable x bound by A ( ( ) ( A y (( E ( r ) ) ( r ))) x r x y x z x x z Scopes of quantifiers are underlined

  8. (LMCS, p. 319) V.8 The following figure indicates all the bound and free variables in the previous formula: free occurrences ( ( ) ( y (( ( r ) ) ( r ))) A A E x r x y x z x x z bound occurrences

  9. (LMCS, p. 322-323) V.9 Examples b. 2 + 2 < 3 is also an atomic sentence, which says “four is less than three.” False in N . c. ∀ x ∃ y ( x < y ) says that “for every number there is a larger number.” True in N . d. ∃ y ∀ x ( x < y ) says that “there is a number that is larger than every other number.” False in N .

  10. (LMCS, p. 323-324) V.10 � � f. ∀ x (0 < x ) → ∃ y ( y · y ≈ x ) says that “every positive number is a square.” False in N . � �� � h. ∀ x ∀ y ( x < y ) → ∃ z ( x < z ) ∧ ( z < y ) says that “if one number is less than another, then there is a number properly between the two.” False in N .

  11. (LMCS, p. 323-324) V.11 We will use the shorthand notation � F i 1 ≤ i ≤ n to mean the same as the notation F 1 ∧ · · · ∧ F n . Likewise, we will use the notations � F i 1 ≤ i ≤ n and F 1 ∨ · · · ∨ F n .

  12. (LMCS, p. 324-325) V.12 English to First-order Given a first–order formula F ( x ) we can find first–order sentences to say a. There is at least one number such that F ( x ) is true in N . ∃ x F ( x ) b. There are at least two numbers such that F ( x ) is true in N . � � ∃ x ∃ y ¬ ( x ≈ y ) ∧ F ( x ) ∧ F ( y )

  13. (LMCS, p. 324-325) V.13 c. There are at least numbers ( n fixed) n such that F ( x ) is true in N . ��� � �� �� ∃ x 1 · · · ∃ x n 1 ≤ i<j ≤ n ¬ ( x i ≈ x j ) ∧ 1 ≤ i ≤ n F ( x i ) d. There are infinitely many numbers that make F ( x ) true in N . � � ∀ x ∃ y ( x < y ) ∧ F ( y ) e. There is at most one number such that F ( x ) is true in N . � � ( F ( x ) ∧ F ( y )) → ( x ≈ y ) ∀ x ∀ y

  14. (LMCS, p. 325) V.14 Definable Relations To better understand what we can express with first–order sentences we need to introduce definable relations. Given a first–order formula F ( x 1 , . . . , x k ) we say F is “true” at a k –tuple ( a 1 , . . . , a k ) of natural numbers if the expression F ( a 1 , . . . , a k ) is a true statement about the natural numbers.

  15. (LMCS, p. 325) V.15 Example Let F ( x, y ) be the formula x < y . Then F is true at ( a, b ) iff a is less than b . Example Let F ( x, y ) be ∃ z ( x · z ≈ y ). Then F is true at ( a, b ) iff divides b , a written a | b . a [ Note: Don’t confuse a | b with b . The first is true or false. The second has a value. Check that a | 0 for any a , including a = 0.]

  16. (LMCS, p. 325) V.16 Definition a formula let F N For F ( x 1 , . . . , x k ) be the set of k –tuples ( a 1 , . . . , a k ) of natural numbers for which F ( a 1 , . . . , a k ) is true in F N N . is the relation on N defined by F . Definition r ⊆ N k A k –ary relation is definable in N if there is a formula F ( x 1 , . . . , x k ) such that r = F N .

  17. (LMCS, p. 325-326) V.17 Example (Definable Relations) • is an even number is definable in N x by ∃ y ( x ≈ y + y ) • divides is definable in N by x y ∃ z ( x · z ≈ y ) • is prime is definable in N by x � �� � (1 < x ) ∧ ∀ y ( y | x ) → ( y ≈ 1) ∨ ( y ≈ x ) modulo is definable in N by • x ≡ y n � � ( x ≈ y + n · z ) ∨ ( y ≈ x + n · z ) ∃ z

  18. (LMCS, p. 326) V.18 We will adopt the following abbreviations: • x | y for the formula ∃ z ( x · z ≈ y ) prime ( x ) for the formula • � �� � (1 < x ) ∧ ∀ y ( y | x ) → ( y ≈ 1) ∨ ( y ≈ x ) . Note that in the definition of prime ( x ) we have used the previous abbreviation. To properly write prime ( x ) as a first–order formula we need to replace that abbreviation; doing so gives us � �� � (1 < x ) ∧ ∀ y ∃ z ( y · z ≈ x ) → ( y ≈ 1) ∨ ( y ≈ x )

  19. (LMCS, p. 326) V.19 Abbreviations are not a feature of first–order logic, but rather they are a tool used by people to discuss first–order logic. Why do we use abbreviations? Without them, writing out the first–order sentences that we find interesting would fill up lines with tedious, hard–to–read symbolism.

  20. (LMCS, p. 326) V.20 Given: x | y abbreviates ∃ z ( x · z ≈ y . Then ( u + 1) | ( u · u + 1) is an abbreviation for ∃ z (( u + 1) · z ≈ u · u + 1) Now let us write out z | 2 to obtain ∃ z ( z · z ≈ 1 + 1) Unfortunately, this last formula does not define the set of elements in that N divide 2. It is a first–order sentence that is simply false in N —the square root of 2 is not a natural number.

  21. (LMCS, p. 326) V.21 We have stumbled onto one of the subtler points of first–order logic, namely, we must be careful with substitution . The remedy for defining “z divides 2” is to use another formula, like ∃ w ( x · w ≈ y ) , for “ x divides y .”

  22. (LMCS, p. 326) V.22 We obtain such a formula by simply renaming the bound variable z in the formula for x | y . With this formula we can correctly express “ z divides 2” by ∃ w ( z · w ≈ 2). The danger in using abbreviations in first–order logic is that we forget the names of the bound variables in the abbreviation.

  23. (LMCS, p. 327) V.23 Our solution: add a to the abbreviation to ⋆ alert the reader to the necessity for renaming the bound variables that overlap with the variables in the term to be substituted into the abbreviation. prime ⋆ ( y + z ) For example, alerts the reader to the need to change the formula for prime ( x ), say to � �� � (1 < x ) ∧ ∀ v ( v | x ) → ( v ≈ 1) ∨ ( v ≈ x ) , so that when we substitute y + z for in x the formula, no new occurrence of or y z becomes bound.

  24. (LMCS, p. 327) V.24 Thus we could express prime ( y + z ) by � �� � (1 < y + z ) ∧ ∀ v ( v | ⋆ ( y + z )) → ( v ≈ 1) ∨ ( v ≈ y + z ) . Examples [Expressing statements in first-order logic.] a. The relation “divides” is transitive. �� � � ( x | y ) ∧ ( y | ⋆ z ) → ( x | ⋆ z ) ∀ x ∀ y ∀ z b. There are an infinite number of primes. � � ( x < y ) ∧ prime ⋆ ( y ) ∀ x ∃ y

  25. (LMCS, p. 327) V.25 d. There are an infinite number of pairs of primes that differ by the number 2. ( Twin Prime Conjecture ) � � ( x < y ) ∧ prime ⋆ ( y ) ∧ prime ⋆ ( y + 2) ∀ x ∃ y e. All even numbers greater than two are the sum of two primes. ( Goldbach’s Conjecture ) �� � (2 | x ) ∧ (2 < x ) ∀ x → �� � prime ⋆ ( y ) ∧ prime ( z ) ∧ ( x ≈ y + z ) ∃ y ∃ z

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend