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.

Slides:



Advertisements
Similar presentations
Discrete Math Methods of proof 1.
Advertisements

Introduction to Proofs
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Elementary Number Theory and Methods of Proof
22C:19 Discrete Structures Logic and Proof Spring 2014 Sukumar Ghosh.
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.
CMSC 250 Discrete Structures Number Theory. 20 June 2007Number Theory2 Exactly one car in the plant has color H( a ) := “ a has color”  x  Cars –H(
So far we have learned about:
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic Autumn 2011 CSE 3111.
First Order Logic (chapter 2 of the book) Lecture 3: Sep 14.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2.1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Fall 2002CMSC Discrete Structures1 Let’s proceed to… Mathematical Reasoning.
CS 2210 (22C:019) Discrete Structures Logic and Proof Spring 2015 Sukumar Ghosh.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Introduction to Proofs
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 03: PROOFS Section 1.5 Jarek Rossignac CS1050: Understanding.
MATH 224 – Discrete Mathematics
Methods of Proof. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical theorems. Direct.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
Section 1.8. Section Summary Proof by Cases Existence Proofs Constructive Nonconstructive Disproof by Counterexample Nonexistence Proofs Uniqueness Proofs.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
Proofs1 Elementary Discrete Mathematics Jim Skon.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
1 Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2011 Suprakash Datta Office: CSEB 3043 Phone: ext
Methods of Proof Lecture 3: Sep 9. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical.
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.
Course Overview and Road Map Computability and Logic.
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.
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
1 Introduction to Abstract Mathematics Proofs in Predicate Logic , , ~, ,  Instructor: Hayk Melikya Purpose of Section: The theorems.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
First Order Logic Lecture 3: Sep 13 (chapter 2 of the book)
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
22C:19 Discrete Structures Logic and Proof Fall 2014 Sukumar Ghosh.
CS104:Discrete Structures Chapter 2: Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Week 3 - Monday.  What did we talk about last time?  Predicate logic  Multiple quantifiers  Negating multiple quantifiers  Arguments with quantified.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
1 Chapter 2.1 Chapter 2.2 Chapter 2.3 Chapter 2.4 All images are copyrighted to their respective copyright holders and reproduced here for academic purposes.
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2012 CSE
1 Introduction to Abstract Mathematics Chapter 3: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 3.1.
Section 1.8. Proof by Cases Example: Let b = max{a, b} = a if a ≥ b, otherwise b = max{a, b} = b. Show that for all real numbers a, b, c
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Methods of Proof Lecture 4: Sep 20 (chapter 3 of the book, except 3.5 and 3.8)
Chapter 1, Part III: Proofs With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Foundations of Computing I CSE 311 Fall Announcements Homework #2 due today – Solutions available (paper format) in front – HW #3 will be posted.
Chapter 1 Logic and proofs
The Foundations: Logic and Proofs
CS 2210:0001 Discrete Structures Logic and Proof
Chapter 4 (Part 1): Induction & Recursion
Argument An argument is a sequence of statements.
Chapter 3 The Logic of Quantified Statements
Predicate Calculus Validity
CS201: Data Structures and Discrete Mathematics I
The Foundations: Logic and Proofs
CSE 311: Foundations of Computing
CS 220: Discrete Structures and their Applications
First Order Logic Rosen Lecture 3: Sept 11, 12.
Introduction to Predicates and Quantified Statements I
MA/CSSE 474 More Math Review Theory of Computation
CS201: Data Structures and Discrete Mathematics I
Introduction to Proofs
Presentation transcript:

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 logic, a logic on quantified statements. First order logic is much more expressive than propositional logic. The topics on first order logic are: Quantifiers Negation Multiple quantifiers Arguments of quantified statements (Optional) Important theorems, applications

Propositional logic – logic of simple statements Limitation of Propositional Logic How to formulate Pythagoreans’ theorem using propositional logic? c b a How to formulate the statement that there are infinitely many primes?

Predicates are propositions (i.e. statements) with variables x + 2 = yExample:P (x,y) ::= Predicates x = 1 and y = 3: P(1,3) is true x = 1 and y = 4: P(1,4) is false  P(1,4) is true The domain of a variable is the set of all values that may be substituted in place of the variable. When there is a variable, we need to specify what to put in the variables.

Set RSet of all real numbers ZSet of all integers QSet of all rational numbers means that x is an element of A (pronounce: x in A) means that x is not an element of A (pronounce: x not in A) Sets can be defined explicitly: e.g. {1,2,4,8,16,32,…}, {CSC1130,CSC2110,…} To specify the domain, we often need the concept of a set. Roughly speaking, a set is just a collection of objects. Some examples Given a set, the (only) important question is whether an element belongs to it.

Truth Set Sets can be defined by a predicate Given a predicate P(x) where x has domain D, the truth set of P(x) is the set of all elements of D that make P(x) true. Let P(x) be “x is a prime number”, and the domain D of x is the set of positive integers. Then the truth set is the set of all positive integers which are prime numbers. Let P(x) be “x is the square of a number”, and the domain D of x is the set of positive integers. Then the truth set is the set of all positive integers which are the square of a number. e.g. Sometimes it is inconvenient or impossible to define a set explicitly.

for ALL x xx The Universal Quantifier c b a  x Z  y Z, x + y = y + x. The universal quantifier Pythagorean’s theorem Example: This statement is true if the domain is Z, but not true if the domain is R. The truth of a statement depends on the domain.

The Existential Quantifier yyThere EXISTS some y Domain Truth value positive integers  + integers  negative integers  - negative reals  - T e.g. The truth of a statement depends on the domain. T F T

Translating Mathematical Theorem Fermat (1637): If an integer n is greater than 2, then the equation a n + b n = c n has no solutions in non-zero integers a, b, and c. Andrew Wiles (1994)

Goldbach’s conjecture: Every even number is the sum of two prime numbers. How to write prime(p)? Translating Mathematical Theorem Suppose we have a predicate prime(x) to determine if x is a prime number.

Quantifiers Negation Multiple quantifiers Arguments of quantified statements (Optional) Important theorems, applications

Negations of Quantified Statements Everyone likes football. What is the negation of this statement? (generalized) DeMorgan’s Law Not everyone likes football = There exists someone who doesn’t like football. Say the domain has only three values. The same idea can be used to prove it for any number of variables, by mathematical induction.

Negations of Quantified Statements There is a plant that can fly. What is the negation of this statement? Not exists a plant that can fly = every plant cannot fly. (generalized) DeMorgan’s Law Say the domain has only three values. The same idea can be used to prove it for any number of variables, by mathematical induction.

Quantifiers Negation Multiple quantifiers Arguments of quantified statements (Optional) Important theorems, applications

Order of Quantifiers There is an anti-virus program killing every computer virus. How to interpret this sentence? For every computer virus, there is an anti-virus program that kills it. For every attack, I have a defense: against MYDOOM, use Defender against ILOVEYOU, use Norton against BABLAS, use Zonealarm …  is expensive!

Order of Quantifiers There is an anti-virus program killing every computer virus. There is one single anti-virus program that kills all computer viruses. How to interpret this sentence? I have one defense good against every attack. Example: P is CSE-antivirus, protects against ALL viruses That’s much better! Order of quantifiers is very important!

Order of Quantifiers Let’s say we have an array A of size 6x Then this table satisfies the statement.

Order of Quantifiers Let’s say we have an array A of size 6x But if the order of the quantifiers are changes, then this table no longer satisfies the new statement.

Order of Quantifiers Let’s say we have an array A of size 6x To satisfy the new statement, there must be a row with all ones.

Questions Are these statements equivalent? Yes, in general, you can change the order of two “foralls”, and you can change the order of two “exists”.

More Negations There is an anti-virus program killing every computer virus. What is the negation of this sentence? For every program, there is some virus that it can not kill.

Exercises 1.There is a smallest positive integer. 2.There is no smallest positive real number. 3.There are infinitely many prime numbers.

Exercises 1.There is a smallest positive integer. 2.There is no smallest positive real number. 3.There are infinitely many prime numbers.

Quantifiers Negation Multiple quantifiers Arguments of quantified statements (Optional) Important theorems, applications

True no matter what the Domain is, or the predicates are.  z [Q(z)  P(z)] → [  x.Q(x)   y.P(y)] Predicate Calculus Validity True no matter what the truth values of A and B are Propositional validity Predicate calculus validity That is, logically correct, independent of the specific content.

Arguments with Quantified Statements Universal instantiation: Universal modus ponens: Universal modus tollens:

Universal Generalization valid rule providing c is independent of A e.g. given any number c, 2c is an even number => for all x, 2x is an even number. Informally, if we could prove that R(c) is true for an arbitrary c (in a sense, c is a “variable”), then we could prove the for all statement. Remark: Universal generalization is often difficult to prove, we will introduce mathematical induction to prove the validity of for all statements.

Proof: Give countermodel, where  z [Q(z)  P(z)] is true, but  x.Q(x)   y.P(y) is false. In this example, let domain be integers, Q(z) be true if z is an even number, i.e. Q(z)=even(z) P(z) be true if z is an odd number, i.e. P(z)=odd(z)  z [Q(z)  P(z)] → [  x.Q(x)   y.P(y)] Valid Rule? Find a domain, and a predicate. Then  z [Q(z)  P(z)] is true, because every number is either even or odd. But  x.Q(x) is not true, since not every number is an even number. Similarly  y.P(y) is not true, and so  x.Q(x)   y.P(y) is not true.

Proof: Assume  z [Q(z)  P(z)]. So Q(z)  P(z) holds for all z in the domain D. Now let c be some element in the domain D. So Q(c)  P(c) holds (by instantiation), and therefore Q(c) by itself holds. But c could have been any element of the domain D. So we conclude  x.Q(x). (by generalization) We conclude  y.P(y) similarly (by generalization). Therefore,  x.Q(x)   y.P(y) QED.  z D [Q(z)  P(z)] → [  x D Q(x)   y D P(y)] Valid Rule?

Quantifiers Negation Multiple quantifiers Arguments of quantified statements Important theorems, applications

Mathematical Proof We prove mathematical statements by using logic. not valid To prove something is true, we need to assume some axioms! This was invented by Euclid in 300 BC, who began with 5 assumptions about geometry, and derived many theorems as logical consequences.

Ideal Mathematical World What do we expect from a logic system? What we prove is true. (soundness) What is true can be proven. (completeness) Hilbert’s program To resolve foundational crisis of mathematics (e.g. paradoxes) Find a finite, complete set of axioms, and provide a proof that these axioms were consistent.

Power of Logic Good news: Gödel's Completeness Theorem Only need to know a few axioms & rules, to prove all validities. That is, starting from a few propositional & simple predicate validities, every valid first order logic formula can be proved using just universal generalization and modus ponens repeatedly! modus ponens

For any “reasonable” theory that proves basic arithmetic truth, an arithmetic statement that is true, but not provable in the theory, can be constructed. Gödel's Incompleteness Theorem for Arithmetic Limits of Logic (Optional) Any theory “expressive” enough can express the sentence (very very brief) proof idea: “This sentence is not provable.” If this is provable, then the theory is inconsistent. So it is not provable.

For any “reasonable” theory that proves basic arithemetic truth, it cannot prove its consistency. Gödel's Second Incompleteness Theorem for Arithmetic No hope to find a complete and consistent set of axioms?! An excellent project topic: Limits of Logic (Optional)

Applications of Logic Logic programming Database Digital circuit solve problems by logic making queries, data mining

Express (quantified) statements using logic formula Use simple logic rules (e.g. DeMorgan, contrapositive, etc) Fluent with arguments and logical equivalence Summary This finishes the introduction to logic, half of the first part. In the other half we will use logic to do mathematical proofs. At this point, you should be able to: