Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Slides:



Advertisements
Similar presentations
Completeness and Expressiveness
Advertisements

Slides adapted from Michael P. Frank ' s course based on the text Discrete Mathematics & Its Applications (5 th Edition) by Kenneth H. Rosen CS2013 Mathematics.
Mathematics for Computing Science
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
Elementary Number Theory and Methods of Proof
Section 1.6: Sets Sets are the most basic of discrete structures and also the most general. Several of the discrete structures we will study are built.
2009/91 Predicates and Quantifiers (§1.3) In the sentence “x is greater than 3”: The phrase “x” denotes the subject - the object or entity that the sentence.
1 Predicate Logic Rosen 6 th ed., § Predicate Logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
Module #1 - Logic 5/16/2015Michael Frank / Kees van Deemter1 Predicate Logic Rosen 5 th ed., §§ (but much extended) ~135 slides, ~5 lectures.
Logic and Proof. Argument An argument is a sequence of statements. All statements but the first one are called assumptions or hypothesis. The final statement.
First Order Logic (chapter 2 of the book) Lecture 3: Sep 14.
Monadic Predicate Logic is Decidable Boolos et al, Computability and Logic (textbook, 4 th Ed.)
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 11 Introduction to Predicate Logic Limitations of Propositional Logic Predicates, quantifiers and propositions.
Discrete Math 6A Max Welling. Recap 1. Proposition: statement that is true or false. 2. Logical operators: NOT, AND, OR, XOR, ,  3. Compound proposition:
First Order Logic. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about first order.
Section 1.3: Predicates and Quantifiers
Methods of Proof & Proof Strategies
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
Logical Equivalence & Predicate Logic
MATH 224 – Discrete Mathematics
1st-order Predicate Logic (FOL)
Review I Rosen , 3.1 Know your definitions!
10/17/2015Michael Frank / Kees van Deemter1 University of Aberdeen, Computing Science CS3518 Lecture on Models and Satisfiability Further details: K.Rosen,
CSE 311 Foundations of Computing I Lecture 8 Proofs and Set Theory Spring
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
Chapter 2 Mathematical preliminaries 2.1 Set, Relation and Functions 2.2 Proof Methods 2.3 Logarithms 2.4 Floor and Ceiling Functions 2.5 Factorial and.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Copyright © Curt Hill Quantifiers. Copyright © Curt Hill Introduction What we have seen is called propositional logic It includes.
Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems or solving problems, creativity and insight.
January 30, 2002Applied Discrete Mathematics Week 1: Logic and Sets 1 Let’s Talk About Logic Logic is a system based on propositions.Logic is a system.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
CompSci 102 Discrete Math for Computer Science
Module #1 - Logic 11/24/2015Michael Frank / Kees van Deemter1 University of Aberdeen, Computing Science CS3511 Discrete Methods Kees van Deemter Slides.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
2.1 Sets 2.2 Set Operations –Set Operations –Venn Diagrams –Set Identities –Union and Intersection of Indexed Collections 2.3 Functions 2.4 Sequences and.
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
LOGIC AND QUANTIFIERS. INTRODUCTION Many algorithms and proofs use logical expressions such as: “IF p THEN q” or “If p1 AND p2, THEN q1 OR q2” Therefore.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
First Order Logic Lecture 3: Sep 13 (chapter 2 of the book)
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
CS104:Discrete Structures Chapter 2: Proof Techniques.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
1 Introduction to Abstract Mathematics Chapter 3: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 3.1.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
Logic Hubert Chan [O1 Abstract Concepts] [O2 Proof Techniques]
Discrete Math - Module #1 - Logic
Chapter 3 The Logic of Quantified Statements
Logic Hubert Chan [O1 Abstract Concepts] [O2 Proof Techniques]
The Foundations: Logic and Proofs
Proving Existentials A proof of a statement of the form x P(x) is called an existence proof. If the proof demonstrates how to actually find or construct.
Discrete Math - Module #1 - Logic
Predicate Logic (§1.3) Predicate logic is an extension of propositional logic that permits concisely reasoning about whole classes of entities. Propositional.
First Order Logic Rosen Lecture 3: Sept 11, 12.
Negations of quantifiers
Predicates and Quantifiers
Presentation transcript:

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d. be parking spaces at UF. Let P(x) be “x is occupied.” Let Q(x) be “x is free of charge.” 1.  x (Q(x)  P(x)) 2.  x (Q(x)  P(x)) 3.  x (Q(x)  P(x)) 4.  x (Q(x)  P(x))

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter2 II. Construct a model where 1 and 4 are true, while 2 and 3 are false 1.  x (Q(x)  P(x)) (true for place a below) 2.  x (Q(x)  P(x)) (false for places b below) 3.  x (Q(x)  P(x)) (false for place b below) 4.  x (Q(x)  P(x)) (true for place a below) One solution: a model with exactly two objects in it. One object has the property Q and the property P; the other object has the property Q but not the property P. In a diagram: a: Q P b: Q not-P a: Q P b: Q not-P

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter3 III. Construct a model where 1 and 3 and 4 are true, but 2 is false 1.  x (Q(x)  P(x)) 2.  x (Q(x)  P(x)) 3.  x (Q(x)  P(x)) 4.  x (Q(x)  P(x)) Here is such a model (using a diagram). It has just two objects in its u.d., called a and b: a: Q P b: not-Q P a: Q P b: not-Q P

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter4 Quantifier Equivalence Laws Expanding quantifiers: If u.d.=a,b,c,…  x P(x)  P(a)  P(b)  P(c)  …  x P(x)  P(a)  P(b)  P(c)  …Expanding quantifiers: If u.d.=a,b,c,…  x P(x)  P(a)  P(b)  P(c)  …  x P(x)  P(a)  P(b)  P(c)  … From those, we can “prove” the laws:  x P(x)   x  P(x)  x P(x)   x  P(x)From those, we can “prove” the laws:  x P(x)   x  P(x)  x P(x)   x  P(x) Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter5 Remember In propositional logic, we can strictly speaking only build formulas of finite size.In propositional logic, we can strictly speaking only build formulas of finite size. E.g., we can write P(a)  P(b) P(a)  P(b)  P(c) P(a)  P(b)  P(c)  P(d), etc.E.g., we can write P(a)  P(b) P(a)  P(b)  P(c) P(a)  P(b)  P(c)  P(d), etc. But this way, we could never say that all natural numbers have PBut this way, we could never say that all natural numbers have P

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter6 Formulas of infinite length? In predicate logic, you can say this easily:  xP(x)In predicate logic, you can say this easily:  xP(x) It’s sometimes useful to pretend that propositional logic allows infinitely long formulas, but in the “official” version this is not possible.It’s sometimes useful to pretend that propositional logic allows infinitely long formulas, but in the “official” version this is not possible.

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter7 More Equivalence Laws  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x)) Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter8 More Equivalence Laws  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x)) Let’s prove the last of these equivalences using the definition of the truth of a formula of the form  x φLet’s prove the last of these equivalences using the definition of the truth of a formula of the form  x φ Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter9 A Pred. Log. equivalence proven  x (P(x)  Q(x))  (  x P(x))  (  x Q(x)) Proof:   x (P(x)  Q(x)) is true. So, there is a constant a such that (P(x)  Q(x)) (x:=a) is true. So, for that a, the formula P is true. One possibility is that P(a) is true. In this case, P(x)(x:=a) is true. So,  x P(x)  x P(x))  (  x Q(x)) is true. The other possibility is that Q(a) is true. In this case, Q(x)(x:=a) is true. So,  x Q(x)  x P(x))  (  x Q(x)) is true.  x (P(x)  Q(x))  (  x P(x))  (  x Q(x)) Proof:  Suppose  x (P(x)  Q(x)) is true. So, there is a constant a such that (P(x)  Q(x)) (x:=a) is true. So, for that a, the formula P(a)  Q(a) is true. One possibility is that P(a) is true. In this case, P(x)(x:=a) is true. So,  x P(x) is true, so (  x P(x))  (  x Q(x)) is true. The other possibility is that Q(a) is true. In this case, Q(x)(x:=a) is true. So,  x Q(x) is true, so (  x P(x))  (  x Q(x)) is true. Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter10 A Pred. Log. equivalence proven  x (P(x)  Q(x))  (  x P(x))  (  x Q(x)) Proof:  (  x P(x))  (  x Q(x))is true. One possibility is that  x P(x) is true. This would mean that there is an a such that P(x) (x:=a) is true. So, for that constant a, Pis true.Therefore, P(a)  Q(a) would also be true. Hence, (P(x)  Q(x))(x:=a) would be true. Hence,  x (P(x)  Q(x)) would be true. The other possibility is that  x Q(x). From this,  x (P(x)  Q(x)) is proven in the same way QED  x (P(x)  Q(x))  (  x P(x))  (  x Q(x)) Proof:  Suppose (  x P(x))  (  x Q(x)) is true. One possibility is that  x P(x) is true. This would mean that there is an a such that P(x) (x:=a) is true. So, for that constant a, P(a) is true.Therefore, P(a)  Q(a) would also be true. Hence, (P(x)  Q(x))(x:=a) would be true. Hence,  x (P(x)  Q(x)) would be true. The other possibility is that  x Q(x). From this,  x (P(x)  Q(x)) is proven in the same way QED Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter11 More Equivalence Laws  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x  y P(x,y)   y  x P(x,y)  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))  x (P(x)  Q(x))  (  x P(x))  (  x Q(x)) How about this one?How about this one?  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))?  x (P(x)  Q(x))  (  x P(x))  (  x Q(x))? Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter12 More Equivalence Laws How about this one?How about this one?  x (P(x)  Q(x))  (  x P(x))  (  x Q(x)) ?  x (P(x)  Q(x))  (  x P(x))  (  x Q(x)) ? This equivalence statement is false. Counterexample (i.e. model making this false):This equivalence statement is false. Counterexample (i.e. model making this false): P(x): x’s birthday is on 30 April Q(x): x’s birthday is on 20 DecemberP(x): x’s birthday is on 30 April Q(x): x’s birthday is on 20 December Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter13 Cases to think carefully about Let’s discuss some specific cases These might seem unusual, but it’s important not to loose your way when they occur These might seem unusual, but it’s important not to loose your way when they occur 1.Quantifiers that don’t bind any variables 2.Quantification in an empty u.d. 3.  x (Q(x)  P(x)) when  yQ(y)

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter14 1. Quantifiers that do not bind:  xP(b) Recall definition: Let  be a formula. Then  x  is true in D if every expression  (x:=a) is true in D, and false otherwise.Recall definition: Let  be a formula. Then  x  is true in D if every expression  (x:=a) is true in D, and false otherwise.  xP(b) is true in D if every expression of the form P(b)(x:=a) is true in D, and false otherwise.  xP(b) is true in D if every expression of the form P(b)(x:=a) is true in D, and false otherwise. What is the set of all the expression of the form P(b)(x:=a)?What is the set of all the expression of the form P(b)(x:=a)?

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter15 Consider  xP(b) What is the set of all the expression of the form P(b)(x:=a)?What is the set of all the expression of the form P(b)(x:=a)? That’s the singleton set {P(b)} ! So,That’s the singleton set {P(b)} ! So,  xP(b) is true in D if P(b) is true, and false otherwise.  xP(b) is true in D if P(b) is true, and false otherwise. So,  xP(b) means just P(b)So,  xP(b) means just P(b)

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter16 2. Empty u.d.: We defined Let  be a formula. Then the proposition  x  is true in D if every expression  (x:=a) is true in D, and false otherwise.Let  be a formula. Then the proposition  x  is true in D if every expression  (x:=a) is true in D, and false otherwise. This is read as follows: Let  be a formula. Then the proposition  x  is false in D if at least one expression  (x:=a) is false in D, and true otherwise.Let  be a formula. Then the proposition  x  is false in D if at least one expression  (x:=a) is false in D, and true otherwise.

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter17  could have been defined differently. For example, Let  be a formula. Then the proposition  x  is true in D if D is nonempty and every expression  (x:=a) is true in D, and false otherwise.Let  be a formula. Then the proposition  x  is true in D if D is nonempty and every expression  (x:=a) is true in D, and false otherwise. –Under this definition,  x P(x) would have been false whenever D is empty (e.g., when there are no parking spaces at U.F., and P = “occupied”) –But that’s not how it’s done!

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter18 Suppose D is empty Suppose the u.d. is empty. Consider  x P(x) (e.g., P(x) means “x is occupied.”)  x P(x) (e.g., P(x) means “x is occupied.”) This counts as true. (Sometimes called “vacuously true”) For the same reason,  x  P(x) is also true  x  P(x) is also true

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter19 Consequences of the standard position Two logical equivalences in Predicate Logic:  x P(x)   x  P(x) (“no counterexample against P”)  x P(x)   x  P(x) So, one of the two quantifiers suffices (cf., functional completeness of a set of connectives in propositional logic) We’ll return to these equivalences later.

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter20 3.  x (Q(x)  P(x)) when  yQ(y)

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter21 When many implications are combined Consider the formula r =  x (Q(x)  P(x)) with respect to a nonempty u.d.Consider the formula r =  x (Q(x)  P(x)) with respect to a nonempty u.d. Suppose  yQ(y)Suppose  yQ(y) (For example, Q might mean “being more than 4 meters tall”)(For example, Q might mean “being more than 4 meters tall”) Can you work out whether r is true?Can you work out whether r is true?

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter22 When many implications are combined Consider  x (Q(x)  P(x)) in a nonempty u.d.Consider  x (Q(x)  P(x)) in a nonempty u.d. Suppose, however,  yQ(y)Suppose, however,  yQ(y) Then Q(a)  P(a) is true for every a (since Q(a) is false for every a)Then Q(a)  P(a) is true for every a (since Q(a) is false for every a) Consequently  x (Q(x)  P(x)) is trueConsequently  x (Q(x)  P(x)) is true Once again, we sometimes say: it is vacuously true (because the antecedent is always false, so you can never use the formula to conclude that P holds of something).Once again, we sometimes say: it is vacuously true (because the antecedent is always false, so you can never use the formula to conclude that P holds of something).

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter23 Vacuous truth Example 1: Think of a tax form: “Have you sent us details about all your children?” No children  You’ve complied (without doing anything)Example 1: Think of a tax form: “Have you sent us details about all your children?” No children  You’ve complied (without doing anything) Example 2: Think of our definition of  (x:=a) as “the result of substituting all free occurrences of x in  by a” No occurrences  don’t do anything (after which it’s true that all occurrences have been substituted)Example 2: Think of our definition of  (x:=a) as “the result of substituting all free occurrences of x in  by a” No occurrences  don’t do anything (after which it’s true that all occurrences have been substituted)

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter24 Some consequences of these definitions Sometimes, predicate logic is taught very informallySometimes, predicate logic is taught very informally This makes it easy to understand simple formulasThis makes it easy to understand simple formulas But each more complex case has to be explained separately, as if it was an exceptionBut each more complex case has to be explained separately, as if it was an exception By defining things properly once, complex formulas fall out as special casesBy defining things properly once, complex formulas fall out as special cases One example: quantifier nestingOne example: quantifier nesting

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter25 Back to Quantifier Exercise R(x,y)=“x relies upon y”. Suppose the u.d. is empty. Now consider these formulas: 1.  x(  y R(x,y)) 2.  y(  x R(x,y)) 3.  x(  y R(x,y)) Which of them is most informative? Which of them is least informative? Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter26 Back to our Quantifier Exercise Now that the u.d. is empty, 1.  x(  y R(x,y)) is uninformative 2.  y(  x R(x,y)) is false! 3.  x(  y R(x,y)) is uninformative  x(P(x)) is true if P(a) is true for all a. If no x exist then this makes  x(P(x)) (“vacuously”) true If no x exist then this makes  x(P(x)) (“vacuously”) true  x(P(x)) is true if P(a) is true for some a. If no x exist then this makes  x(P(x)) false. If no x exist then this makes  x(P(x)) false. Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter27 Back to models: Look at the old formula 3 again 3.  x (Q(x)  P(x)) Consider this model: a:  Q P b:  Q  P a:  Q P b:  Q  P c:  Q P d:  Q  P c:  Q P d:  Q  P Is the proposition true or false in the model?

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter28 Look at formula number 3 again 3.  x (Q(x)  P(x)) is true in this model: a:  Q P b:  Q  P a:  Q P b:  Q  P c:  Q P d:  Q  P c:  Q P d:  Q  P (3) Is true iff each of these is true:  x (Q(a)  P(a))  x (Q(b)  P(b))  x (Q(c)  P(c))  x (Q(d)  P(d))

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter29 Look at formula number 3 again 3.  x (Q(x)  P(x)) is true in this model: a:  Q P b:  Q  P a:  Q P b:  Q  P c:  Q P d:  Q  P c:  Q P d:  Q  P (3) Is true because each of these is true: Q(a)  P(a) … F T, hence T Q(b)  P(b) … F F, hence T Q(c)  P(c) … F T, hence T Q(d)  P(d) … F F, hence T

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter30 Predicate Logic essentials Predicates of different arity (one-place, two- place, etc.)Predicates of different arity (one-place, two- place, etc.) Quantifiers: [  x P(x)] :≡ “For all x, P(x).” [  x P(x)] :≡ “There is/are x such that P(x).”Quantifiers: [  x P(x)] :≡ “For all x, P(x).” [  x P(x)] :≡ “There is/are x such that P(x).” Universes of discourse, bound & free vars.Universes of discourse, bound & free vars. The rest follows: empty domains, quantified implications, quantifier nestingThe rest follows: empty domains, quantified implications, quantifier nesting

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter31 Some common shorthands Sometimes the universe of discourse is restricted within the quantification, e.g.,Sometimes the universe of discourse is restricted within the quantification, e.g., –  x>0 P(x) is shorthand for “For all x that are greater than zero, P(x).” How would you write this in formal notation?How would you write this in formal notation? Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter32 Some common shorthands Sometimes the universe of discourse is restricted within the quantification, e.g.,Sometimes the universe of discourse is restricted within the quantification, e.g., –  x>0 P(x) is shorthand for “For all x that are greater than zero, P(x).” =  x ( x>0  P(x) ) Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter33 Some common shorthands Sometimes the universe of discourse is restricted within the quantification, e.g.,Sometimes the universe of discourse is restricted within the quantification, e.g., –  x>0 P(x) is shorthand for “For all x that are greater than zero, P(x).” =  x ( x>0  P(x) ) –  x>0 P(x) is shorthand for “There is an x greater than zero such that P(x).” =  x ( x>0  P(x) ) Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter34 Some common shorthands Consecutive quantifiers of the same type can be combined:  xyz P(x,y,z)  def  x  y  z P(x,y,z)  xyz P(x,y,z)  def  x  y  z P(x,y,z)Consecutive quantifiers of the same type can be combined:  xyz P(x,y,z)  def  x  y  z P(x,y,z)  xyz P(x,y,z)  def  x  y  z P(x,y,z) Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter35 Theorems about logic We are studying logical languages/calculi to allow you to use them (better)We are studying logical languages/calculi to allow you to use them (better) Logicians study logical languages/calculi to understand their limitationsLogicians study logical languages/calculi to understand their limitations Meta-theorems can, e.g., say things like “… cannot be expressed in predicate logic”Meta-theorems can, e.g., say things like “… cannot be expressed in predicate logic”

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter36 Theorems about logic About propositional logic, we asked “What types of things can we express?” How many connectives do we need?About propositional logic, we asked “What types of things can we express?” How many connectives do we need? About predicate logic, logicians ask similar questions. For example, are these two quantifiers enough to be able to ‘say everything’?About predicate logic, logicians ask similar questions. For example, are these two quantifiers enough to be able to ‘say everything’? This is a question about the expressive power of predicate logicThis is a question about the expressive power of predicate logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter37 Example: one As per their name, quantifiers can be used to express that a predicate is true of a given quantity (number) of objects.As per their name, quantifiers can be used to express that a predicate is true of a given quantity (number) of objects. Example: Can predicate logic say “there exists at most one object with property P”?Example: Can predicate logic say “there exists at most one object with property P”?

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter38 Example: at most one Example: Can predicate logic say “there exists at most one object with property P”?Example: Can predicate logic say “there exists at most one object with property P”? Yes (provided we have equality): Yes (provided we have equality):  x  y (( P(x)  P(y))  x= y )  x  y (( P(x)  P(y))  x= y )

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter39 Example: one Can predicate logic say “there exists exactly one object with property P”?Can predicate logic say “there exists exactly one object with property P”?

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter40 Example: one Can predicate logic say “there exists exactly one object with property P”?  xP(x)   x  y (( P(x)  P(y))  x= y)Can predicate logic say “there exists exactly one object with property P”?  xP(x)   x  y (( P(x)  P(y))  x= y) “There exist x such that P(x)” and “There exists at most one x such that P(x)”“There exist x such that P(x)” and “There exists at most one x such that P(x)” Abbreviation:  !x P(x) (“there exists exactly one x such that P(x)”)Abbreviation:  !x P(x) (“there exists exactly one x such that P(x)”)

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter41 Example: one Another way to write this:Another way to write this:  x ( P(x)   y ( P(y)  y  x ) ) “There is an x such that P(x), such that there is no y such that P(y) and y  x.”  x ( P(x)   y ( P(y)  y  x ) ) “There is an x such that P(x), such that there is no y such that P(y) and y  x.”  x binds x throughout the conjunction:  x ( P(x)   y ( P(y)  y  x ) )  x binds x throughout the conjunction:  x ( P(x)   y ( P(y)  y  x ) )

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter42 At least two Can predicate logic say “there exist at least two objects with property P”?Can predicate logic say “there exist at least two objects with property P”?

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter43 At least two Can predicate logic say “there exist at least two objects with property P”?Can predicate logic say “there exist at least two objects with property P”? Yes:  x  y ( (P(x)  P(y))  x  y )Yes:  x  y ( (P(x)  P(y))  x  y ) Incorrect would be  xP(x)   y(P(y)  x  y), (where x occurs free, and which therefore does not express a proposition)Incorrect would be  xP(x)   y(P(y)  x  y), (where x occurs free, and which therefore does not express a proposition)

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter44 Exactly two Can predicate logic say “there exist exactly two objects with property P”?Can predicate logic say “there exist exactly two objects with property P”?

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter45 Exactly wo Can predicate logic say “there exist exactly two objects with property P”?Can predicate logic say “there exist exactly two objects with property P”? Yes:Yes:  x  y ( P(x)  P(y)  x  y   z ( P(z)  (z= x  z= y) ) )  x  y ( P(x)  P(y)  x  y   z ( P(z)  (z= x  z= y) ) )

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter46 What’s wrong with  x  y (P(x)  P(y)  x  y)   z ( P(z)  (z= x  z= y ) ) as a formalisation of ‘exactly two’?  x  y (P(x)  P(y)  x  y)   z ( P(z)  (z= x  z= y ) ) as a formalisation of ‘exactly two’?

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter47 What’s wrong with  x  y (P(x)  P(y)  x  y)   z ( P(z)  (z= x  z= y ) ) as a formalisation of ‘exactly two’?  x  y (P(x)  P(y)  x  y)   z ( P(z)  (z= x  z= y ) ) as a formalisation of ‘exactly two’? This is a conjunction of two separate propositions. As a result, x and y are not bound, so this is not even a propositionThis is a conjunction of two separate propositions. As a result, x and y are not bound, so this is not even a proposition

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter48 infinitely many Can predicate logic say “there exist infinitely many objects with property P”?Can predicate logic say “there exist infinitely many objects with property P”? No! [This follows from the so-called Compactness Theorem: “An infinite set S of formulas has a model iff every finite subset of S has a model”]No! [This follows from the so-called Compactness Theorem: “An infinite set S of formulas has a model iff every finite subset of S has a model”] How about finitely many?How about finitely many?

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter49 finitely many How about finitely many?How about finitely many? Suppose there existed a formula  = “there exist only finitely many x such that so and so”Suppose there existed a formula  = “there exist only finitely many x such that so and so” Then  = “there exist infinitely many x such that so and so”Then  = “there exist infinitely many x such that so and so” We know that such a formula does not existWe know that such a formula does not exist So, also  does not existSo, also  does not exist

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter50 ( Of course if we allow infinite conjunctions then all this can be expressed:  !x P(x)   2!x P(x)   3!x P(x)  … ) ( Of course if we allow infinite conjunctions then all this can be expressed:  !x P(x)   2!x P(x)   3!x P(x)  … )

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter51 Can predicate logic say “most objects have property P”?Can predicate logic say “most objects have property P”? No! [This follows from the Compactness Theorem as well. Again, this is unless we allow infinitely long disjunctions.]No! [This follows from the Compactness Theorem as well. Again, this is unless we allow infinitely long disjunctions.] Can predicate logic say “many objects have property P”?Can predicate logic say “many objects have property P”? No, only precisely defined quantitiesNo, only precisely defined quantities

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter52 Bonus: Number Theory Examples Let u.d. = the natural numbers 0, 1, 2, … What do the following mean?  x (E(x)  (  y x=2y))  x (E(x)  (  y x=2y))  x ( P(x)  (x>1   yz x=yz  y  1  z  1 ) )  x ( P(x)  (x>1   yz x=yz  y  1  z  1 ) ) Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter53 Bonus: more Number Theory Examples Let u.d. = the natural numbers 0, 1, 2, …Let u.d. = the natural numbers 0, 1, 2, … “A number x has the property E if and only if it is equal to 2 times some other number.” (even!)  x (E(x)  (  y x=2y))“A number x has the property E if and only if it is equal to 2 times some other number.” (even!)  x (E(x)  (  y x=2y)) “A number has P, iff it’s greater than 1 and it isn’t the product of any non-unity numbers.” (prime!)“A number has P, iff it’s greater than 1 and it isn’t the product of any non-unity numbers.” (prime!)  x ( P(x)  (x>1   yz x=yz  y  1  z  1 ) )  x ( P(x)  (x>1   yz x=yz  y  1  z  1 ) ) Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter54 Goldbach’s Conjecture (unproven) Using E(x) and P(x) from previous slide,  x( [x>2  E(x)] →  x( [x>2  E(x)] →  p  q P(p)  P(q)  p+q = x).  p  q P(p)  P(q)  p+q = x). Topic #3 – Predicate Logic

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter55 Goldbach’s Conjecture (unproven) Using E(x) and P(x) from previous slide,  x( [x>2  E(x)] →  x( [x>2  E(x)] →  p  q P(p)  P(q)  p+q = x).  p  q P(p)  P(q)  p+q = x). “Every even number greater than 2 is the sum of two primes.” Topic #3 – Predicate Logic