FOL Con(nued Review Variable Names Note that just because variables have different names it does not mean they have different values e.g. over the domain of positive integers x. y. (x+y=2) is True, (exctly when x=y=1) But multiple occurrences of the same variable governed by one quantifier must be the same e.g. over the domain of integers x. (x+x=3) is False The rules of nesting multiple quantifiers with the same name are tricky. Avoid this x ( x Q(x) y P(x,y) ) Write instead the following, where variable x is renamed x ( z Q(z) y P(x,y) ) Some Ques(ons about Quan(fiers (but answers are not proven just stated here!)! Can you switch the order of quantifiers??! yes! The left and the right side will always have the same truth value. The order in which x and y are picked does not matter.?! No! The left and the right side may have different truth values for some propositional functions for P. Try U={a,b}, with P=likes, and facts {likes(a,b), likes(b,a)}. Then LHS is true, RHS is false NOTE: when something is not true, find smallest universe in which it is false, and fewest facts which provide a counter-example.
Some Ques(ons about Quan(fiers (but answers are not proven just stated!)! Can you distribute quantifiers over logical connectives?! Is this a valid equivalence? Yes! The left and the right side will always have the same truth value no matter what propositional functions are denoted by P(x) and Q(x).! Is this a valid equivalence? No! The left and the right side may have different truth values. Pick x = 1 for P(x) and x = 5 for Q(x) with U={1,5}. Then the left side is false, (when x is 5), but the rhs is always true bec. x(x=1) is False This is why we need rules of inference/equivalence dealing with quantifiers! Beware of universe issues Every student takes some course! If predicate takes(x,y) uses universe students for x but courses for y, then the real universe for the statement x y takes(x,y) is the union of students and courses! (And this statement is likely to be false according to the intuitive meaning of takes since courses do not take students or courses.)! So if you wanted to state that every student takes some course you would need to qualify the variables: x.( student(x) -> y (course(y) /\ takes(x,y) ) )! In general, Forall is used as an implication with a domain guard. Exists is used as a conjunction with a domain guard Transla(ng Mathema(cal Statements Example : Translate The sum of two positive integers is always positive into a logical expression. 1. Rewrite the statement to make the implied quantifiers and domains explicit: For every two integers, if these integers are both positive, then the sum of these integers is positive. 2. Introduce the variables x and y, and specify the domain (integers), to obtain: For all positive integers x and y, x + y is positive. 3. The result is: x y ((x > 0) (y > 0) (x + y > 0)) where the domain consists of all integers (Aside: why having small domains is not good) Example : Different translation of The sum of two positive integers is always positive 1. Rewrite the statement to make the implied quantifiers and domains explicit: For every two positive integers, if they are both positive, then the sum of these integers is positive. 2. Introduce the variables x and y, and specify the domain (positive integers), to obtain: For all positive integers x and y, x + y is positive. 3. The result is: x y (x + y > 0) where the domain consists of all positive integers But now note that the constant 0 appearing in the formula does not belong to the domain! (This is illegal in standard logic, where all constants must belong to U)
Transla(ng English into FOL Example: Use quantifiers to express the statement There is a woman who has taken a flight on every airline in the world. 1. Let Took(w,f) be w has taken f and FlightOf(f,a) be f is a flight of a. 2. The domain of w is all women, the domain of f is all flights, and the domain of a is all airlines. (This means that the total domain is the union of these!) 3. Then the statement can be expressed as: Equivalences in Predicate Logic w.{ woman(w) a. [airline(a) f.(?light(f) Took (w,f) FlightOf (f,a))]} Note that the formula w. a. f.(took(w,f) FlightOf(f,a)) reads there is a w such that for all a (including women, flights, airlines) there is f such that... f is a flight on a. Since a can be other things than airlines in the quantification, yet FlightOf(_,a) might only be true of airline a, FLightOf(,a) will be false when a is a woman!!! 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 universe! Example: x S(x) x S(x)! The proof rules of equivalence require entire subformulas to be substituted with equivalent ones. So even if x S(x) y S(y) you cannot take just x S(x) from x ( S(x) Q(x) ) and replace it by the equivalent y S(y). The resulting formula y ( S(y) \/ Q(x) ) would NOT be equivalent!!! Quan(fiers as Conjunc(ons and Disjunc(ons! If the domain is finite, a universally quantified proposition is equivalent to a conjunction of propositions without quantifiers and an existentially quantified proposition is equivalent to a disjunction of propositions without quantifiers.! If U = {1,2,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.! What if the domain is empty? NOT ALLOWED!! But the following is legal: suppose predicate F(x) is always false: x. F(x) P(x) x. False P(x) True x. F(x) P(x) x. False P(x) False
Nega(ng Quan(fied Expressions 1. Consider x Smart(x) Every student is smart. Here Smart(x) is x smart and the domain is students 2. Negating the original statement gives It is not the case that every student is smart. This implies that There is a student in your class who is not smart.! And conversely: from 2. one gets 1. x Smart(x) and x Smart(x) are equivalent Nega(ng Quan(fied Expressions (2) 1. Consider x Smart(x) Some student is smart. Here Smart(x) is x smart and the domain is students 2. Negating the original statement gives It is not the case that some student is smart. This implies that Every student is not smart.! And conversely: from 2. one gets 1. x Smart(x) and x Smart(x) are equivalent De Morgan s Laws for Quan(fiers! The rules for negating quantifiers, according to Rosen are:! These are important. You will use these.! (One of the rules is redundant!!) Nega(ng Nested Quan(fiers Example 1: Consider the logical expression w a f (P(w,f ) Q(f,a)) Use De Morgan s Laws to move the negation as far inwards as possible. (on board) 1. w a f (P(w,f ) Q(f,a)) 2. w a f (P(w,f ) Q(f,a)) by De Morgan s for 3. w a f (P(w,f ) Q(f,a)) by De Morgan s for 4. w a f (P(w,f ) Q(f,a)) by De Morgan s for 5. w a f ( P(w,f ) Q(f,a)) by De Morgan s for.
Equivalences in First Order Logic The rules of equivalence for FOL consist of the rules of equivalence for propositional formulas + the 2 de Morgan rules for quantifiers Which rule you can apply to a (sub) formula depends on which connective is the upper-most connective:! in f (P(f ) Q(3)), the upper-most connective is! in f P(f ) Q(3), the upper-most connective is (remember that quantiziers have highest precedence so this formula was really ( f.p(f )) Q(3). When in doubt ask or parenthesize to disambiguate.)! in f.(p(f ) Q(3)) the upper-most-connective is Note that in all of these, you could have applied the equivalence Q(3) Q(3) inside the formulas, if you wanted, because equivalences can be applied to subformulas. [Remember that rules of inference, later, must match patterns against entire lines of a proof.] (Excercise for you: nega(ng English Part 1: Use quantifiers to express the statement that There does not exist a woman who has taken a flight on every airline in the world. w.{woman(w) a.[airline(a) [formula above ] f.(?light(f) P(w,f) Q(f,a))]} Part 2: Now use De Morgan s Laws to move the negation as far inwards as possible. [do this yourself, changing A B to A B ] Part 3: Translate the result back into English? For every woman there is an airline such that for all flights, this woman has not taken that flight or that flight is not on this airline