Logic Overview, I DEFINITIONS A statement (proposition) is a declarative sentence that can be assigned a truth value T or F, but not both. Statements are denoted by letters p, q, r, s,... The 5 basic logical connectives are: (not), (inclusive or), (and), (implies), (if and only if). Their truth tables are: not p p T F F T or p q p q T F T F T T F F F and p q p q T F F F T F F F F implies p q p q T F F F T T F F T if and only if p q p q T F F F T F F F T A compound statement is a statement built from other statements using the basic logical connectives. The truth value of a compound statement is determined by the truth values of its component statements and the truth tables associated with the logical connectives. The converse of an implication p q is the implication q p. The contrapositive of an implication p q is the implication q p. An implication and its contrapositive are logically equivalent, meaning that they always take the same truth values. We use between statements to denote logical equivalence. A compound statement is a tautology if it always takes the truth value T. It is a contradiction if it always takes the truth value F, and it is a contingency if it is neither a tautology nor a contradiction. We use 1, 0 to denote unspecified tautologies and contradictions, respectively. statements? This statement is false no 2 + 3 = 8 yes (false, but still a statement) Atlanta is the capital of Georgia yes Don t try this at home no x + 3 = 7 no (this is a predicate, not a statement) x + y = y + x for all real numbers x and y yes Negate the following: Today is Thursday Bob is tall and he eats ice cream His shirt is black or it is a turtleneck. If you pack an umbrella it will not rain. The copier jams if and only if I am using it. Identify atomic statements, denote them by letters, and use logical connectives to symbolize. You can t ride this roller coaster if you are < 4 ft tall unless you are > 16 yrs old. The dog barks only when he is hungry. My headache is gone but my tooth hurts. Are the following tautologies, contradictions, or contingencies? p p, p p, p (p q), (p q) ( p q) Use truth tables to prove these are logically equivalent. (p q) ( p) ( q) p q ( p) q
Logic Overview, II BASIC LOGICAL EQUIVALENCES The following logical equivalences (and any substitution instances of them) can be used to formally simplify compound statements. They are also used to determine if two statements are logically equivalent, or to determine if a statement is a tautology, contradiction, or contingency. Use of these laws is an alternative to using truth tables. Truth tables are a semantic tool and logical equivalences are a syntactic tool. Both kinds of tools are commonly used in the study of logical systems. equivalence p 1 p p 0 p p 1 1 p 0 0 p p p p p p ( p) p p q q p p q q p identity laws domination laws idempotent laws double negation law commutative laws equivalence p (q r) (p q) r p (q r) (p q) r p (q r) (p q) (p r) p (q r) (p q) (p r) (p q) p q (p q) p q p (p q) p p (p q) p p p 1 p p 0 associative laws distributive laws De Morgan s laws absorption laws negation laws Use the laws to show (p ( p q)) p q. (p ( p q)) p ( p q)) de morgan p ( p q) de morgan p (p q) dble negative ( p p) ( p q) distributivity 0 ( p q) negation laws ( p q) 0 commutativity p q. identity
Logic Overview, III LOGICAL EQUIVALENCES INVOLVING AND Although the connectives,, and the above equivalences technically suffice for the logic of statements, it is much more natural (particularly in mathematics) to include and among our basic connectives, and make use of the following additional equivalences: equivalences involving p q p q elimination p q q p contrapositive (p q) p q negation (p q) r (p r) (q r) disjunctive hypothesis (p q) r (p r) (q r) conjunctive hypothesis p (q r) (p q) (p r) disjunctive consequence p (q r) (p q) (p r) conjunctive consequence equivalences involving p q (p q) (q p) p q p q p q (p q) ( p q) (p q) p q double implication biconditional inverse elimination alternation Show p q is logically equivalent to q p. Show p (q r) is not logically equivalent to (p q) r.
Logic Overview, IV PREDICATES AND QUANTIFIERS Mathematics deals with many statements involving variables, which leads us to consider a more sophisticated (and more natural) logical system beyond basic logic, known as predicate logic. A statement P (x) that involves a variable is neither true nor false when the value of the variable is not specified or quantified. We refer to such a statement as a (unary) predicate. A binary predicate has two variables, etc. A statement can be formed from a predicate by specifying the variable(s), as in P (1) or P (3). The domain from which these variables can be assigned is called the universe of discourse, and must be explicitly stated whenever predicate logic is used. Another way to form a statement from a predicate is to quantify the variable(s). There are two kinds of quantifiers, universal and existential. The universal quantification of P (x) is the statement xp (x), which asserts that P (x) is true for all values of x in the universe of discourse. The existential quantification of P (x) is the statement xp (x), which asserts that P (x) is true for some (at least one) value of x in the universe of discourse. equivalences involving quantifiers x P (x) x P (x) x P (x) x P (x) x y P (x, y) y xp (x, y) x y P (x, y) y xp (x, y) generalized De Morgan s laws commutative laws It should be noted that universal and existential quantifiers do not, in general, commute with each other. In other words, x yp (x, y) is not logically equivalent with y xp (x, y). Are the following statements true or false? x(x 3 = 1) x(( x) 2 = x 2 ) y x(x + y = 3) x y((x > 0 y < 0) xy < 0) Express the following in predicate logic. The sum of two positive integers is positive. For all ɛ > 0 there exists δ > 0 such that if 0 < x a < δ then f(x) L < ɛ. Negate and simplify. x y(xy = 1)
Logic Overview, V VALID ARGUMENTS AND RULES OF INFERENCE An argument is meant to establish the implication of a specific statement q, called the conclusion, from some set of specific assumptions p 1,..., p n, called the hypotheses. In other words, one wishes to prove that (p 1 p n ) q is a tautology. A valid argument is one in which the conclusion q must be true whenever the hypotheses p 1,..., p n are all true. To deduce a conclusion from a set of hypotheses, the following rules of inference are often used: modus ponens modus tollens disjun. syllogism chain rule resolution simplification conjunction p p q p q p q p r p q p p q q p q r q r q p q p r p q p p q When quantifiers are involved, the following additional rules of inference may be useful: universal instantiation universal generalization existential instantiation existential generalization xp (x) P (c) for an arbitrary c xp (x) P (c) for some element c P (c) xp (x) P (c) for some element c xp (x) Formulate and prove the following. A student in this class hasn t read the book. Everyone in this class passed the first exam. Therefore, someone who passed the exam didn t read the book. Solution. Let the universe of discourse be the set of all students. Let C(x) denote x is in this class. Let B(x) denote x read the book. Let P (x) denote x passed the exam. Then x(c(x) B(x)) premise C(a) B(a) for some a exist. instan. C(a) simplification x(c(x) P (x) premise C(a) P (a) universal instant. P (a) modus ponens B(a) simplification P (a) B(a) conjunction x(p (x) B(x)) exist. genrlztn
Logic Overview, VI COMMON METHODS OF PROOF A direct proof is an argument to establish an implication p q by assuming p and constructing a sequence of valid inferences that establish the statement q. An indirect proof also establishes an implication p q, but does so by way of the contrapositive: one assumes q and constructs an argument that p must follow. A proof by contradiction establishes a statement p by proving p must be false. In particular, one assumes p and shows that a contradiction arises from this assumption. A proof by cases establishes a statement q by considering a number of cases p 1, p 2,..., p n, one of which must hold, and showing that in each of these cases, p i q. A proof of equivalence of a set of statements p 1, p 2,..., p n establishes p 1 p 2 p n. One constructs, and proves, a chain of implications among the statements in such a way that it is possible to work through the chain from any statement to any other. A commonly used example of such a chain is p 1 p 2, p 2 p 3,... p n p 1. An existence proof establishes a statement of the form xp (x). There are two kinds. A constructive proof is given by providing an explicit element c and establishing P (c). A nonconstructive proof is any other proof of xp (x) that does not provide an explicit element c such that P (c). For example, one might proceed by contradiction and show that x P (x) is impossible. Mathematical theorems often assert the existence of a unique element satisfying a given predicate. For such theorems, a uniqueness proof must be supplied. That is, one must first prove the existence, as described above, but then one must also argue the uniqueness of the element under discussion. In other words, after proving xp (x), a uniqueness proof also requires that you prove x y((p (x) P (y)) (x = y)). It is worth remarking that if you are trying to argue that a universally quantified statement xp (x) is false, you need only provide a single counterexample, an element c such that P (c). Prove the following. For any integer n, if n is odd, then n 2 is odd. For any integer n, if 3n + 2 is odd, then n 2 is odd. At least 4 of any 22 days must fall on the same weekday. For all real x, y, xy = x y For any integer n, the following are equivalent: (i) n is even. (ii) n 1 is odd. (iii) n 2 is even. There exists a positive integer that can be written as the sum of 2 cubes of positive integers in 2 different ways. There exist irrational numbers x,y such that x y is rational. Every integer has a unique additive inverse.