* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Propositional Logic
Survey
Document related concepts
Transcript
Predicates and Quantifiers Dr. Yasir Ali 1. Predicates 2. Quantifiers a. Universal Quantifiers b. Existential Quantifiers 3. Negation of Quantifiers 4. Universal Conditional Statement 1. Negation of Universal Conditional 5. Multiple Quantifiers 1. Precedence of quantifiers 2. Order of quantifiers 6. Translation It is frequently necessary to reason logically about statements of the form Everything has the property p or something has the property p. One of the oldest and most famous pieces of logical reasoning, which was known to the ancient Greeks, is an example: All men are mortal. Socrates is a man. Therefore Socrates is mortal. Predicate logic, also called first order logic, is an extension to propositional logic that adds two quantifiers that allow statements like the examples above to be expressed. Everything in propositional logic is also in predicate logic: all the definitions, inference rules, theorems, algebraic laws, etc., still hold. βEvery computer connected to the university network is functioning properly.β No rules of propositional logic allow us to conclude the truth of the statement βMATH3 is functioning properly,β Where MATH3 is one of the computers connected to the university network. Predicate A predicate is a statement that an object π₯ has a certain property. Such statements may be either true or false. Or more formally, A predicate is a sentence that contains a finite number of variables and becomes a statement when specific values are substituted for the variables. The domain of a predicate variable is the set of all values that may be substituted in place of the variable. Let P(x) be the statement βthe word x contains the letter a.β What are these truth values? 1. P(orange) 2. P(lemon) 3. P(true) 4. P(false) Let π(π₯) be the predicate βπ₯ 2 > π₯β with domain the set R of all 1 β1 real numbers. Write π(2), π( ), and π( ), and indicate which 2 2 of these statements are true and which are false. Truth Set of a predicate When an element in the domain of the variable of a onevariable predicate is substituted for the variable, the resulting statement is either true or false. The set of all such elements that make the predicate true is called the truth set of the predicate. Let π(π₯) be the predicate βπ₯ > 1/π₯.β 1 β1 1. Write π 2 , π , π(β1), π( ), and P(β8), and indicate 2 2 which of these statements are true and which are false. 2. Find the truth set of π(π₯) if the domain of π₯ is R, the set of all real numbers. 3. If the domain is the set R+ of all positive real numbers, what is the truth set of π(π₯)? Let Q(x, y) denote the statement βx = y + 3.β What are the truth values of the propositions Q(1, 2) and Q(3, 0)? Quantifiers β’ One sure way to change predicates into statements is to assign specific values to all their variables. β’ For example, if x represents the number 35, the sentence βx is divisible by 5β is a true statement since 35 = 5· 7. β’ Another way to obtain statements from predicates is to add quantifiers. β’ Quantifiers are words that refer to quantities such as βsomeβ or βallβ and tell for how many elements a given predicate is true. Quantifiers The Universal Quantifier: Let π(π₯) be a predicate and π· the domain of π₯. A universal statement is a statement of the form ββπ₯ β π·, π(π₯).β It is defined to be true if, and only if, π(π₯) is true for every π₯ in π·. It is defined to be false if, and only if, π(π₯) is false for at least one π₯ in π·. A value for x for which π(π₯) is false is called a counterexample to the universal statement. Besides βfor allβ and βfor every,β universal quantification can be expressed in many other ways, including βall of,β βfor each,β βgiven any,β βfor arbitrary,β βfor each,β and βfor any.β Example: 1. Let π· = {1, 2, 3, 4, 5}, and consider the statement βπ₯ β π·, π₯ 2 β₯ π₯. Show that this statement is true. 2. Consider the statement βπ₯ β πΉ, π₯ 2 β₯ π₯. Find a counterexample to show that this statement is false. Note: When all elements in the domain can be listedβsay, π₯1 , π₯2 , . . . , π₯π the Universal quantificationβπ₯ π(π₯) is the same as the conjunction π π₯1 β§π π₯2 β§ · · · β§π(π₯π ), because this disjunction is true if and only if all of π(π₯1 ), π((π₯2 ), . . . , π (π₯π ) is true and false if atleast one of them is false. Existential Quantifier Let π(π₯) be a predicate and π· the domain of π₯. An existential statement is a statement of the form ββπ₯ β π· π π’πβ π‘βππ‘ π(π₯).β It is defined to be true if, and only if, π(π₯) is true for at least one π₯ in π·. It is false if, and only if, π(π₯) is false for all π₯ in π·. Besides the phrase βthere existsβ, we can also express existential quantification in many other ways, such as by using the words βfor some,β βfor at least one,β or βthere is.β The existential quantification βπ₯ π(π₯) is read as βThere is an π₯ such that π(π₯),β βThere is at least one π₯ such that π(π₯),β or βFor some π₯ π(π₯).β Consider the following statement: β πππ πππ‘ππππ ππππ¦πππ π₯, π₯ ππ π‘πππ. Which of the following are equivalent ways of expressing this statement? 1. Every basketball player is tall. 2. Among all the basketball players, some are tall. 3. Some of all the tall people are basketball players. 4. Anyone who is tall is a basketball player. 5. All people who are basketball players are tall. 6. Anyone who is a basketball player is a tall person. Consider the following statement: βπ₯ β πΉ π π’πβ π‘βππ‘ π₯ 2 = 2. Which of the following are equivalent ways of expressing this statement? 1. The square of each real number is 2. 2. Some real numbers have square 2. 3. The number π₯ has square 2, for some real number π₯. 4. If π₯ is a real number, then π₯ 2 = 2. 5. Some real number has square 2. 6. There is at least one real number whose square is 2. Rewrite the following formal statements in a variety of equivalent but more informal ways. Do not use the symbol β or β. 1. βπ₯ β πΉ, π₯ 2 β₯ 0. β’ All real numbers have nonnegative squares. β’ Or: Every real number has a nonnegative square. β’ Or: Any real number has a nonnegative square. β’ Or: The square of each real number is nonnegative. 2. βπ₯ β πΉ, π₯ 2 β β1. β’ All real numbers have squares that are not equal to β1. β’ Or: No real numbers have squares equal to β1. (The words none are or no . . . are equivalent to the words all are not.) 3. βπ β π+ π π’πβ π‘βππ‘ π2 = π. β’ There is a positive integer whose square is equal to itself. β’ Or: We can find at least one positive integer equal to its own square. β’ Or: Some positive integer equals its own square. Rewrite each of the following statements formally. Use quantifiers and variables. 1. All dinosaurs are extinct. 2. Every real number is positive, negative, or zero. 3. No irrational numbers are integers. 4. Some exercises have answers. 5. Some real numbers are rational. Example: 1. Consider the statement βπ β π+ such that π2 = π. Show that this statement is true. 2. Let πΈ = {5, 6, 7, 8} and consider the statement βπ β πΈ such that π2 = π. Show that this statement is false. Note: When all elements in the domain can be listedβsay, π₯1 , π₯2 , . . . , π₯π the existential quantification βπ₯ π(π₯) is the same as the disjunction π(π₯1 ) β¨ π(π₯2 ) β¨ · · · β¨ π(π₯π ), because this disjunction is true if and only if at least one of π(π₯1 ), π((π₯2 ), . . . , π (π₯π ) is true and false if all of them are false. Statement When True? When False? βπ₯ π(π₯) π(π₯) is true for every π₯. There is an π₯ for which π(π₯) is false. βπ₯ π(π₯) There is an π₯ for which π(π₯) is true. π(π₯) is false for every π₯. Negation of Quantified Statement Also known as De Morganβs Law for Quantifiers Negation Equivalent Statement When Is Negation True? When False? οΏ’βπ₯π(π₯) βπ₯οΏ’π(π₯) For every π₯, π(π₯) is false. There is an π₯ for which π(π₯) is true. οΏ’βπ₯π(π₯) βπ₯οΏ’π(π₯) There is an π₯ for which π(π₯) is false. π(π₯) is true for every π₯. What are the negations of the statements βThere is an honest politicianβ and βAll Americans eat cheeseburgersβ? Let H(x) denote βx is honestβ and C(x) denote βx eats cheeseburgers.β Universal Conditional Statements βπ₯, ππ π(π₯) π‘βππ π(π₯). Rewrite the following statement informally, without quantifiers or variables. βπ₯ β πΉ, ππ π₯ > 2 π‘βππ π₯ 2 > 4. If a real number is greater than 2 then its square is greater than 4. Negation What is the negation of οΏ’βπ₯(π(π₯) β π(π₯))? βπ₯(π(π₯) β§ οΏ’π(π₯)) Write the negation of the following statement: βπ₯ β πΉ, ππ π₯ > 2 π‘βππ π₯ 2 > 4. Some real number greater than two has a square less or equal to 4. Translating from English into Logical Expressions Consider the following statements. A β‘ Small animals are good pets. C β‘ Cats are animals. S β‘ Cats are small. All we have are three propositions: A, C, and S are known, but nothing else, and the only conclusions that can be drawn are uninteresting ones like π΄ β§ πΆ, π β¨ π΄, and the like. The solution is to use predicates to give a more refined translation of the sentences: A(x) β‘ x is an animal. C(x) β‘ x is a cat. S(x) β‘ x is small. GP(x) β‘ x is a good pet. Now a much richer kind of English sentence can be translated into predicate logic: βπ₯. πΆ(π₯) βπ₯. πΆ(π₯) βπ₯. πΆ(π₯) βπ₯. π(π₯) β π΄(π₯) β‘ Cats are animals. β π(π₯) β‘ Cats are small. β π(π₯) β§ π΄(π₯) β‘ Cats are small animals. β§ π΄(π₯) β πΊπ(π₯) β‘ Small animals are good pets. It is generally straightforward to translate from formal predicate logic into English, since you can just turn each logical operator directly into an English word or phrase. For example, βπ₯. π(π₯) β§ π΄(π₯) β πΊπ(π₯) could be translated into English literally: (1) For every thing, if that thing is small and that thing is an animal, then that thing is a good pet. This is graceless English, but at least itβs comprehensible and correct. The style can be improved: (2) Everything which is small and which is an animal is a good pet. Even better would be: (3) Small animals make good pets.