Discrete Mathematics, Chapter : Predicate Logic

Similar documents
Predicate Logic. Example: All men are mortal. Socrates is a man. Socrates is mortal.

Propositional Logic. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both.

Predicate Logic. For example, consider the following argument:

Handout #1: Mathematical Reasoning

Chapter 7. Functions and onto. 7.1 Functions

INTRODUCTORY SET THEORY

(LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.

Lecture 16 : Relations and Functions DRAFT

2. The Language of First-order Logic

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

Predicate Logic Review

1 if 1 x 0 1 if 0 x 1

Rules of Inference Friday, January 18, 2013 Chittu Tripathy Lecture 05

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

Chapter 1. Use the following to answer questions 1-5: In the questions below determine whether the proposition is TRUE or FALSE

Lecture 8: Resolution theorem-proving

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

How To Understand The Theory Of Hyperreals

The Division Algorithm for Polynomials Handout Monday March 5, 2012

10.2 Series and Convergence

10.4 Traditional Subject Predicate Propositions

Why? A central concept in Computer Science. Algorithms are ubiquitous.

The Syntax of Predicate Logic

Understanding Basic Calculus

1 Propositions. mcs-ftl 2010/9/8 0:40 page 5 #11. Definition. A proposition is a statement that is either true or false.

Logic in Computer Science: Logic Gates

Invalidity in Predicate Logic

The sample space for a pair of die rolls is the set. The sample space for a random number between 0 and 1 is the interval [0, 1].

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

Math 223 Abstract Algebra Lecture Notes

CHAPTER 2: METHODS OF PROOF

Random variables P(X = 3) = P(X = 3) = 1 8, P(X = 1) = P(X = 1) = 3 8.

Formalization of the CRM: Initial Thoughts

5.3 Improper Integrals Involving Rational and Exponential Functions

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

Vocabulary Words and Definitions for Algebra

Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test

MA651 Topology. Lecture 6. Separation Axioms.

Introduction to tuple calculus Tore Risch

First-Order Stable Model Semantics and First-Order Loop Formulas

One More Decidable Class of Finitely Ground Programs

ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS

Deterministic Finite Automata

A Beginner s Guide to Modern Set Theory

Math 3000 Section 003 Intro to Abstract Math Homework 2

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

Rigorous Software Development CSCI-GA

The Convolution Operation

Logic is a systematic way of thinking that allows us to deduce new information

Lecture 7: Continuous Random Variables

3. Mathematical Induction

(a) Write each of p and q as a polynomial in x with coefficients in Z[y, z]. deg(p) = 7 deg(q) = 9

BANACH AND HILBERT SPACE REVIEW

The Point-Slope Form

Cartesian Products and Relations

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

ALGEBRA REVIEW LEARNING SKILLS CENTER. Exponents & Radicals

List the elements of the given set that are natural numbers, integers, rational numbers, and irrational numbers. (Enter your answers as commaseparated

Algebra I Vocabulary Cards

MATHEMATICS IN RELATIVE SET THEORY Karel Hrbacek Department of Mathematics The City College of CUNY New York, NY July 31, 2009

1 Mathematical Models of Cost, Revenue and Profit

Lecture Notes in Discrete Mathematics. Marcel B. Finan Arkansas Tech University c All Rights Reserved

4. CLASSES OF RINGS 4.1. Classes of Rings class operator A-closed Example 1: product Example 2:

CORRELATED TO THE SOUTH CAROLINA COLLEGE AND CAREER-READY FOUNDATIONS IN ALGEBRA

CHAPTER 7 GENERAL PROOF SYSTEMS

JUST THE MATHS UNIT NUMBER 1.8. ALGEBRA 8 (Polynomials) A.J.Hobson

Analyzing Piecewise Functions

! " # The Logic of Descriptions. Logics for Data and Knowledge Representation. Terminology. Overview. Three Basic Features. Some History on DLs

Lecture 2. Marginal Functions, Average Functions, Elasticity, the Marginal Principle, and Constrained Optimization

Predicate logic Proofs Artificial intelligence. Predicate logic. SET07106 Mathematics for Software Engineering

SQL Database queries and their equivalence to predicate calculus

Computational Methods for Database Repair by Signed Formulae

The Foundations of Mathematics

8 Polynomials Worksheet

InvGen: An Efficient Invariant Generator

1. First-order Ordinary Differential Equations

Answers G53KRR

Exercises and Problems in Calculus. John M. Erdman Portland State University. Version August 1, 2013

2.1 Increasing, Decreasing, and Piecewise Functions; Applications

Scalar Valued Functions of Several Variables; the Gradient Vector

x 2 + y 2 = 1 y 1 = x 2 + 2x y = x 2 + 2x + 1

Algebra Unpacked Content For the new Common Core standards that will be effective in all North Carolina schools in the school year.

Algebra 2 PreAP. Name Period

SOLUTIONS TO EXERCISES FOR. MATHEMATICS 205A Part 3. Spaces with special properties

it is easy to see that α = a

MATH 10: Elementary Statistics and Probability Chapter 5: Continuous Random Variables

Mathematics Review for MS Finance Students

Chapter 13: Basic ring theory

Properties of sequences Since a sequence is a special kind of function it has analogous properties to functions:

1.7 Graphs of Functions

The continuous and discrete Fourier transforms

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Polynomials. Key Terms. quadratic equation parabola conjugates trinomial. polynomial coefficient degree monomial binomial GCF

Factoring Quadratic Expressions

DEFINABLE TYPES IN PRESBURGER ARITHMETIC

LEARNING OBJECTIVES FOR THIS CHAPTER

Transcription:

Discrete Mathematics, Chapter 1.4-1.5: Predicate Logic Richard Mayr University of Edinburgh, UK Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 1 / 23

Outline 1 Predicates 2 Quantifiers 3 Equivalences 4 Nested Quantifiers Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 2 / 23

Propositional Logic is not enough Suppose we have: All men are mortal. Socrates is a man. Does it follow that Socrates is mortal? This cannot be expressed in propositional logic. We need a language to talk about objects, their properties and their relations. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 3 / 23

Predicate Logic Extend propositional logic by the following new features. Variables: x, y, z,... Predicates (i.e., propositional functions): P(x), Q(x), R(y), M(x, y),.... Quantifiers:,. Propositional functions are a generalization of propositions. Can contain variables and predicates, e.g., P(x). Variables stand for (and can be replaced by) elements from their domain. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 4 / 23

Propositional Functions Propositional functions become propositions (and thus have truth values) when all their variables are either replaced by a value from their domain, or bound by a quantifier P(x) denotes the value of propositional function P at x. The domain is often denoted by U (the universe). Example: Let P(x) denote x > 5 and U be the integers. Then P(8) is true. P(5) is false. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 5 / 23

Examples of Propositional Functions Let P(x, y, z) denote that x + y = z and U be the integers for all three variables. P( 4, 6, 2) is true. P(5, 2, 10) is false. P(5, x, 7) is not a proposition. Let Q(x, y, z) denote that x y = z and U be the integers. P(1, 2, 3) Q(5, 4, 1) is true. P(1, 2, 4) Q(5, 4, 0) is true. P(1, 2, 3) Q(5, 4, 0) is false. P(1, 2, 4) Q(x, 4, 0) is not a proposition. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 6 / 23

Quantifiers We need quantifiers to formally express the meaning of the words all and some. The two most important quantifiers are: Universal quantifier, For all. Symbol: Existential quantifier, There exists. Symbol: x P(x) asserts that P(x) is true for every x in the domain. x P(x) asserts that P(x) is true for some x in the domain. The quantifiers are said to bind the variable x in these expressions. Variables in the scope of some quantifier are called bound variables. All other variables in the expression are called free variables. A propositional function that does not contain any free variables is a proposition and has a truth value. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 7 / 23

Quantifiers: Example Consider this formula Φ = y. ((P(y) Q(x)) x. (P(x) Q(y) P(z))) How many free variables does this formula contain? Clicker 1 One 2 Two 3 Three 4 Four 5 None Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 8 / 23

Universal Quantifier x P(x) is read as For all x, P(x) or For every x, P(x). The truth value depends not only on P, but also on the domain U. Example: Let P(x) denote x > 0. If U is the integers then x P(x) is false. If U is the positive integers then x P(x) is true. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 9 / 23

Existential Quantifier x P(x) is read as For some x, P(x) or There is an x such that, P(x), or For at least one x, P(x). The truth value depends not only on P, but also on the domain U. Example: Let P(x) denote x < 0. If U is the integers then x P(x) is true. If U is the positive integers then x P(x) is false. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 10 / 23

Uniqueness Quantifier!x P(x) means that there exists one and only one x in the domain such that P(x) is true. 1 x P(x) is an alternative notation for!x P(x). This is read as There is one and only one x such that P(x). There exists a unique x such that P(x). Example: Let P(x) denote x + 1 = 0 and U are the integers. Then!x P(x) is true. Example: Let P(x) denote x > 0 and U are the integers. Then!x P(x) is false. The uniqueness quantifier can be expressed by standard operations.!x P(x) is equivalent to x (P(x) y (P(y) y = x)). Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 11 / 23

Precedence of Quantifiers Quantifiers and have higher precedence then all logical operators. x P(x) Q(x) means ( x P(x)) Q(x). In particular, this expression contains a free variable. x (P(x) Q(x)) means something different. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 12 / 23

Translating English to Logic Translate the following sentence into predicate logic: Every student in this class has taken a course in Java. Solution: First decide on the domain U. Solution 1: If U is all students in this class, define a propositional function J(x) denoting x has taken a course in Java and translate as x J(x). Solution 2: But if U is all people, also define a propositional function S(x) denoting x is a student in this class and translate as x (S(x) J(x)). Note: x (S(x) J(x)) is not correct. What does it mean? Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 13 / 23

Equivalences in Predicate Logic Statements involving predicates and quantifiers are logically equivalent if and only if they have the same truth value for every predicate substituted into these statements and for every domain of discourse used for the variables in the expressions. The notation S T indicates that S and T are logically equivalent. Example: x S(x) x S(x). Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 14 / 23

Quantifiers as Conjunctions/Disjunctions If the domain is finite then universal/existential quantifiers can be expressed by conjunctions/disjunctions. If U consists of the integers 1,2, and 3, then x P(x) P(1) P(2) P(3) x P(x) P(1) P(2) P(3) Even if the domains are infinite, you can still think of the quantifiers in this fashion, but the equivalent expressions without quantifiers will be infinitely long. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 15 / 23

De Morgan s Law for Quantifiers The rules for negating quantifiers are: x P(x) x P(x) x P(x) x P(x) Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 16 / 23

Predicate Calculus An assertion in predicate calculus is valid iff it is true for all domains for every propositional functions substituted for the predicates in the assertion. An assertion in predicate calculus is satisfiable iff it is true for some domain for some propositional functions that can be substituted for the predicates in the assertion. Example: x (F(x) G(x)) is not valid, but satisfiable. Example: x (F(x) F(x)) is unsatisfiable. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 17 / 23

Nested Quantifiers Complex meanings require nested quantifiers. Every real number has an inverse w.r.t. addition. Let the domain U be the real numbers. Then the property is expressed by x y (x + y = 0) Every real number except zero has a multiplicative inverse. Let the domain U be the real numbers. Then the property is expressed by x (x 0 y (x y = 1)) Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 18 / 23

Thinking of Nested Quantification Nested Loops To see if x y P(x, y) is true, loop through the values of x: At each step, loop through the values for y. If for some pair of x and y, P(x, y) is false, then x y P(x, y) is false and both the outer and inner loop terminate. x y P(x, y) is true if the outer loop ends after stepping through each x. To see if x y P(x, y) is true, loop through the values of x: At each step, loop through the values for y. The inner loop ends when a pair x and y is found such that P(x, y) is true. If no y is found such that P(x, y) is true the outer loop terminates as x y P(x, y) has been shown to be false. x y P(x, y) is true if the outer loop ends after stepping through each x. If the domains of the variables are infinite, then this process can not actually be carried out. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 19 / 23

Order of Quantifiers Quantifiers can be grouped into blocks x y... z a b... c u v... w...... Quantifiers can be swapped inside a block, but not between blocks. Let P(x, y) denote x + y = y + x and U be the real numbers. Then x y P(x, y) is equivalent to y x P(x, y). Let Q(x, y) denote x + y = 0 and U be the real numbers. Then x y P(x, y) is true, but y x P(x, y) is false. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 20 / 23

Quantifications of Two Variables Statement When True? When False P(x,y) is true for every pair x,y. For every x there is a y for which P(x,y) is true. There is an x for which P(x,y) is true for every y. There is a pair x, y for which P(x,y) is true. There is a pair x, y for which P(x,y) is false. There is an x such that P(x,y) is false for every y. For every x there is a y for which P(x,y) is false. P(x,y) is false for every pair x,y Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 21 / 23

Negating Nested Quantifiers Let P(x, f ) denote that person x has taken flight f. Let Q(f, a) denote that flight f is operated by airline a. Formulate: There is no person who has taken a flight on every airline in the world. x a f (P(x, f ) Q(f, a)) Now use De Morgan s Laws to move the negation as far inwards as possible. x a f (P(x, f ) Q(f, a)) x a f (P(x, f ) Q(f, a)) x a f (P(x, f ) Q(f, a)) x a f (P(x, f ) Q(f, a)) x a f ( P(x, f ) Q(f, a)) by De Morgan s for by De Morgan s for by De Morgan s for by De Morgan s for Can you translate the result back into English? For every person there is an airline such that for all flights, this person has not taken that flight or that flight is not operated by this airline. Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 22 / 23

An Example from Calculus Express that the limit of a real-valued function f at point a is L. In predicate logic lim f (x) = L x a ɛ δ x ( x a < δ f (x) L < ɛ) where the domain of ɛ and δ are the positive real numbers and the domain of x are all real numbers. Now express its negation, i.e., that lim x a f (x) L. ɛ δ x ( x a < δ f (x) L ɛ) Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.4-1.5 23 / 23