VIEWS: 51 PAGES: 117 POSTED ON: 2/28/2012 Public Domain
Introduction to Symbolic Logic San Diego Math Circle David W. Brown Why learn about logic? Sudoku Law Minesweeper Contracts Mathematics Debate Science Philosophy Engineering Computers Politics? Medical diagnosis Policy? Why study symbolic logic? Symbolic logic excels in separating the formal structure of logical relationships from the material content of the statements being related. With the material content of statements out of the way, we can discover how to “calculate” the properties of logical relationships. Goals Understand: No time now for: • Truth value • Boolean Algebra • Propositions • Sets • Connectives • Predicates • Truth Tables • Quantifiers • Theorems • Venn Diagrams • Inference • Logic gates • Fallacy • Etc. What is Truth? A philosophical, not mathematical matter Mathematically, “true” and “false” are simply the two mutually exclusive values that can be taken by a well-formed formula. True: 1, T, +, up, on, Republican False: 0, F, -, down, off, Democrat What is a “Well-formed formula” ? A “well-formed formula” is any construction that has definite truth value, whether that value is “true” or “false”. Synonymous alternative terms: • Statement • Proposition • Sentence • Wff ( Well-formed formula ) What is an atomic formula? Not something from science fiction or a cold war thriller … Propositions may be compound, constructed from simpler propositions. An “atomic formula” or “atomic sentence”, etc. is one that cannot be decomposed into simpler wffs. Terminology The symbols such as p or q used to represent statements, whether atomic or compound, may be called variously • Statement letters • Literals • Variables (provided the context is clear; in predicate logic variables are used differently) Language We speak in natural language or informal language, which is imprecise, flexible, and expressive. Logic requires formal language, which is precise, rigid, and constructive. Logic can connect natural language statements, but only if those statements have definite truth value. Natural vs. Formal Language Natural language Formal language Why? Why? Two’s company. Today is Saturday. Three’s a crowd. All men are created I love you. equal. OMG! True or false Time flies. 2x2=5 I voted. 1+1=1 Obama rules! McCain lost. Translating Natural Language into Formal Language Roses are red, Violets are blue, Sugar is sweet, and so are you. Translating Natural Language into Formal Language Roses are red, R = “Roses are red” Violets are blue, V = “Violets are blue” Sugar is sweet, S = “Sugar is sweet” and so are you. Y = “You are sweet” Translating Natural Language into Formal Language Roses are red, R = “Roses are red” Violets are blue, V = “Violets are blue” Sugar is sweet, S = “Sugar is sweet” and so are you. Y = “You are sweet” Roses are red and Violets are blue and Sugar is sweet and You are sweet. Translating Natural Language into Formal Language Roses are red, R = “Roses are red” Violets are blue, V = “Violets are blue” Sugar is sweet, S = “Sugar is sweet” and so are you. Y = “You are sweet” Roses are red and R and V and S and Y Violets are blue and Sugar is sweet and You are sweet. Translating Natural Language into Formal Language Roses are red, R = “Roses are red” Violets are blue, V = “Violets are blue” Sugar is sweet, S = “Sugar is sweet” and so are you. Y = “You are sweet” Roses are red and R and V and S and Y Violets are blue and = “and” Sugar is sweet and You are sweet. Translating Natural Language into Formal Language Roses are red, R = “Roses are red” Violets are blue, V = “Violets are blue” Sugar is sweet, S = “Sugar is sweet” and so are you. Y = “You are sweet” Roses are red and R and V and S and Y Violets are blue and = “and” Sugar is sweet and You are sweet. RVSY Translating Natural Language into Formal Language Red sky at night, Sailor’s delight, Red sky at morning, Sailor take warning. Translating Natural Language into Formal Language Red sky at night, N = “The sky is red at night.” Sailor’s delight, G = “Good weather is ahead.” M = “The sky is red at morning” Red sky at morning, B = “Bad weather is ahead.” Sailor take warning. Translating Natural Language into Formal Language Red sky at night, N = “The sky is red at night.” Sailor’s delight, G = “Good weather is ahead.” M = “The sky is red at morning” Red sky at morning, B = “Bad weather is ahead.” Sailor take warning. If the sky is red at night, then Good weather is ahead and If the sky is red at morning, then Bad weather is ahead. Translating Natural Language into Formal Language Red sky at night, N = “The sky is red at night.” Sailor’s delight, G = “Good weather is ahead.” M = “The sky is red at morning” Red sky at morning, B = “Bad weather is ahead.” Sailor take warning. If the sky is red at night, (if N then G) and (if M then B) then Good weather is ahead and If the sky is red at morning, then Bad weather is ahead. Translating Natural Language into Formal Language Red sky at night, N = “The sky is red at night.” Sailor’s delight, G = “Good weather is ahead.” M = “The sky is red at morning” Red sky at morning, B = “Bad weather is ahead.” Sailor take warning. If the sky is red at night, (if N then G) and (if M then B) then Good weather is ahead = “and” → = “if … then” and If the sky is red at morning, then Bad weather is ahead. Translating Natural Language into Formal Language Red sky at night, N = “The sky is red at night.” Sailor’s delight, G = “Good weather is ahead.” M = “The sky is red at morning” Red sky at morning, B = “Bad weather is ahead.” Sailor take warning. If the sky is red at night, (if N then G) and (if M then B) then Good weather is ahead = “and” → = “if … then” and If the sky is red at morning, (N → G) (M → B) then Bad weather is ahead. Translating Natural Language into Formal Language Two wrongs don’t W1 = “Act1 is wrong.” make a right. W2 = “Act2 is wrong.” R = “Act3 is right.” It is not true that a not ( W1 and W2 equivalent R ) wrong act and another ~ = “not” = “and” wrong act are equivalent ↔ = “equivalent” to a right one. ~( W1 W2 ↔ R ) Translating Natural Language into Formal Language All work and no play W = “Jack always works” makes Jack a dull boy. P = “Jack sometimes plays” D = “Jack is a dull boy” If Jack always works and If W and not P, then D. it is not true that Jack ~ = “not” = “and” sometimes plays, then → = “if … then” Jack is a dull boy. ( W ~P ) → D The Propositional Calculus By: • carefully translating natural language statements into formal propositions, • replacing statements with literals, and • replacing relational language with symbols representing precisely-defined logical operations, it becomes possible to calculate the truth value of complex statements; i.e., to reduce argumentation and proof to calculation. Functions, Truth Tables, and Connectives uh … not quite Functions in Logic The concepts of domain and range familiar from algebra apply to functions in logic as well. In propositional logic, however, the elements of the domain and range are truth values “T” and “F” rather than numbers. This greatly limits the possibilities. Functions x f(x) = x2 Algebraic 0 0 f(x) Functions 1 1 2 4 … … X Logical p g(p) Functions T T or F F T or F T F Simple Functions in Algebra We often denote functions in algebra “f(x)”, But some functions are so simple that we don’t use function notation for them. For example, The negation function n(x)=-x we write as “-x”. The identity function i(x)=x we write as “x”. Constant functions c(x)=c we write as “c”. Unary Functions in Logic Unary functions in logic are functions of a single variable much like the functions f(x) of algebra except for the fact that the “variables” represent propositions and the domain and range are extremely small: Domain = { T, F } , Range { T, F } This means that there can exist only 4 unary functions in logic. The four unary functions Identity That these four are • g(p) = p the only ones that Negation can exist can be • g(p) = ~p (or ¬p) seen using an organizing tool Constant True called a truth table • g(p) = T that explicitly Constant False tabulates all • g(p) = F possibilities. Truth Table of the Identity Function Domain Range p p T F Truth Table of the Identity Function Domain Range p p T T F Truth Table of the Identity Function Domain Range p p T T F F Truth Table of the Negation Function Domain Range p ~p T F Truth Table of the Negation Function Domain Range p ~p T F F Truth Table of the Negation Function Domain Range p ~p T F F T Truth Table of the Constant-True Function Domain Range p T T F Truth Table of the Constant-True Function Domain Range p T T T F Truth Table of the Constant-True Function Domain Range p T T T F T Truth Table of the Constant-False Function Domain Range p F T F Truth Table of the Constant-False Function Domain Range p F T F F Truth Table of the Constant-False Function Domain Range p F T F F F Binary Functions In the same sense that a unary function is a function of only one variable, a binary function is a function of two variables. For example: Algebra: f(x,y) = x2 + y2 Logic: g(p,q) = p q Domain and Range for Binary Functions The domain of a binary On the other hand, the function is a Cartesian range of a binary product of unary function still contains domains; i.e., the set just the simple truth of all possible ordered values T and F pairs of truth values: because the output of a function is a single D = { T, F } { T, F } value. = { (T,T), (T,F), R { T, F } (F,T), (F,F) } How many binary functions are there? Domain Range That is, how many p q g(p,q) truth tables? T T T F F T F F How many binary functions are there? Domain Range That is, how many p q g(p,q) truth tables? T T T or F T F T or F F T T or F F F T or F How many binary functions are there? Domain Range That is, how many p q g(p,q) truth tables? T T T or F 2 x 2 x 2 x 2 = 16 T F T or F Thus, there exist exactly 16 binary F T T or F functions in propositional logic. F F T or F From logical functions to connectives It is convenient to notate logical functions g(p,q) using relational symbols “?” called “connectives”, so that “p ? q” means the same thing as g(p,q). We already do this in algebra using relational symbols such as “=”, “>”, etc. that can be viewed as functions from to {T,F}. For example 2=2 is “true” 1 < 5 is “true” 2=1 is “false” e > π is “false” The 16 binary functions and their notation as connectives g(p,q): (negations) = T “true” = F = p q “or” = p↓q = p ←q “only if” = p↚q = p “left identity” = ¬p, ~p = p →q “implies” = p↛q = q “right identity” = ¬q, ~q = p ↔q “equivalent” = pq = p q “and” = p↑q Aren’t 16 connectives overkill? sort of 8 connectives are negations of the other 8. 3 of the remaining 8 (T, p, and q) are not particularly handy as “binary” relations. 4 of the remaining 5 are the real workhorses: , , →, ↔ (Technically … one connective is enough if it is the right one … or .) AND pq Conjunction – “AND” p q pq The domain consists of the four possible T T ordered pairs of truth values (p,q). T F The range consists of the truth values taken F T by the proposition p q for each of these F F ordered pairs. Conjunction – “AND” p q pq The domain consists of the four possible T T T ordered pairs of truth values (p,q). T F The range consists of the truth values taken F T by the proposition p q for each of these F F ordered pairs. Conjunction – “AND” p q pq The domain consists of the four possible T T T ordered pairs of truth values (p,q). T F F The range consists of the truth values taken F T by the proposition p q for each of these F F ordered pairs. Conjunction – “AND” p q pq The domain consists of the four possible T T T ordered pairs of truth values (p,q). T F F The range consists of the truth values taken F T F by the proposition p q for each of these F F ordered pairs. Conjunction – “AND” p and q are called p q pq “conjuncts” T T T “AND” is true only when both T F F conjuncts are true F T F “AND” is false when at least one conjunct is false F F F OR pq Disjunction – “OR” p q pq The domain consists of the four possible T T ordered pairs of truth values (p,q). T F The range consists of the truth values taken F T by the proposition p q for each of these F F ordered pairs. Disjunction – “OR” p q pq The domain consists of the four possible T T T ordered pairs of truth values (p,q). T F The range consists of the truth values taken F T by the proposition p q for each of these F F ordered pairs. Disjunction – “OR” p q pq The domain consists of the four possible T T T ordered pairs of truth values (p,q). T F T The range consists of the truth values taken F T by the proposition p q for each of these F F ordered pairs. Disjunction – “OR” p q pq The domain consists of the four possible T T T ordered pairs of truth values (p,q). T F T The range consists of the truth values taken F T T by the proposition p q for each of these F F ordered pairs. Disjunction – “OR” p and q are called p q pq “disjuncts” T T T “OR” is true when at least one disjunct is true T F T “OR” is false only when both disjuncts are F T T false F F F Note that p and q may be true simultaneously Equivalence p↔q Biconditional - Equivalence p q p↔q The domain consists of the four possible T T ordered pairs of truth values (p,q). T F The range consists of the truth values taken F T by the proposition p q for each of these F F ordered pairs. Biconditional - Equivalence p q p↔q The domain consists of the four possible T T T ordered pairs of truth values (p,q). T F The range consists of the truth values taken F T by the proposition p q for each of these F F ordered pairs. Biconditional - Equivalence p q p↔q The domain consists of the four possible T T T ordered pairs of truth values (p,q). T F F The range consists of the truth values taken F T by the proposition p q for each of these F F ordered pairs. Biconditional - Equivalence p q p↔q The domain consists of the four possible T T T ordered pairs of truth values (p,q). T F F The range consists of the truth values taken F T F by the proposition p q for each of these F F ordered pairs. Biconditional - Equivalence p ↔ q is true when p p q p↔q and q are both true, or both false T T T p ↔ q is false when exactly one of {p,q} is false, or when exactly T F F one of {p,q} is true F T F Also: “if and only if” F F T “iff” “biconditional sentence” Implication p→q The Asymmetry of Implication The truth values of conjunction, dysjunction, and equivalence do not depend on the order in which p and q appear; i.e., these connectives are symmetric. Implication (p → q) is asymmetric – order matters. • p is the antecedent (hypothesis, premise, sufficient condition) • q is the consequent (thesis, conclusion, necessary condition) • the arrow symbolizes the “flow of truth” from p to q, or the ability to conclude the truth of q from the truth of p. Some aspects of this asymmetry can be challenging to understand at first. Conditional – “Implies” p q p→q Part of what we mean by implication is that the T T T truth of antecedent assures the truth of the consequent. T F Thus, the implication F T must be true for the case (T,T). F F Conditional – “Implies” However, if p is true and p q p→q q is false, then the truth of the antecedent does NOT T T T assure the truth of the consequent. T F F This is not what we mean by implication, so the implication F T must be false. Thus, the implication F F must be false for the case (T,F). Truth Values of Implication What should the truth value of implication be when the antecedent is false? That is, what should be the truth value of F → q ? Rather than making an argument regarding what the remaining truth values of implication should be, we will consider what these values must be by explicitly examining all the possibilities. What are the possible truth tables to represent implication? p q ? p q ? T T T T T T T F F T F F F T ? F T ? F F ? F F ? p q ? p q ? T T T T T T T F F T F F F T ? F T ? F F ? F F ? What are the possible truth tables to represent implication? p q p q T T T T T T T F F T F F F T F T F F F F p q p q T T T T T T T F F T F F F T F T F F F F What are the possible truth tables to represent implication? p q p q T T T T T T T F F T F F F T F F T F F F F F p q p q T T T T T T T F F T F F F T F T F F F F What are the possible truth tables to represent implication? p q pq p q T T T T T T T F F T F F F T F F T F F F F F p q p q T T T T T T T F F T F F F T F T F F F F What are the possible truth tables to represent implication? p q pq p q T T T T T T T F F T F F F T F F T F F F F F p q p q T T T T T T T F F T F F F T F T F F F F What are the possible truth tables to represent implication? p q pq p q T T T T T T T F F T F F F T F F T T F F F F F F p q p q T T T T T T T F F T F F F T F T F F F F What are the possible truth tables to represent implication? p q pq p q q T T T T T T T F F T F F F T F F T T F F F F F F p q p q T T T T T T T F F T F F F T F T F F F F What are the possible truth tables to represent implication? p q pq p q q T T T T T T T F F T F F F T F F T T F F F F F F p q p q T T T T T T T F F T F F F T F T F F F F What are the possible truth tables to represent implication? p q pq p q q T T T T T T T F F T F F F T F F T T F F F F F F p q p q T T T T T T T F F T F F F T F F T F F T F F What are the possible truth tables to represent implication? p q pq p q q T T T T T T T F F T F F F T F F T T F F F F F F p q p↔q p q T T T T T T T F F T F F F T F F T F F T F F What are the possible truth tables to represent implication? p q pq p q q T T T T T T T F F T F F F T F F T T F F F F F F p q p↔q p q T T T T T T T F F T F F F T F F T F F T F F What are the possible truth tables to represent implication? p q pq p q q T T T T T T T F F T F F F T F F T T F F F F F F p q p↔q p q T T T T T T T F F T F F F T F F T T F F T F F T What are the possible truth tables to represent implication? p q pq p q q T T T T T T T F F T F F F T F F T T F F F F F F p q p↔q p q p→q T T T T T T T F F T F F F T F F T T F F T F F T What are the possible truth tables to represent implication? p q pq p q q T T T T T T T F F T F F F T F F T T F F F F F F p q p↔q p q p→q T T T T T T T F F T F F F T F F T T F F T F F T Powerful Conclusion Of the four possible ways to finish the truth table for implication, three are already “taken” (pq, p↔q, q) and none of these three “work” anyway: Two are symmetric (pq, p↔q), the third is independent of the antecedent (q), and none of them have the meaning of implication. We necessarily conclude that there is only one binary function that can express the meaning of implication. Conditional – “Implies” p q p→q “Implies” is false only when the antecedent T T T p is true and the consequent q is false T F F Also: F T T “if p then q” “implication” “conditional sentence” F F T “material implication” Vacuous Truth A principle is involved here that may be unfamiliar from common experience but is essential in mathematics – that from a false premise one can “prove” anything; that is, that the implication F → q true independent of q. Truth that follows by implication from a false premise is sometimes called “vacuous truth”. However, there is no functional difference in logic between “truth” and “vacuous truth”; T is T (and you can quote me on that!) Understanding Implication The properties of implication can appear to allow us to arrive at absurd conclusions; for example, the implications • “If the moon is made of green cheese, then Neil Armstrong walked on green cheese”, and • “If 1=0, then Pluto is officially a planet” are both true, even though all of the premises and conclusions are false and each implication seems absurd. Understanding Implication The appearance of absurdity derives not from the formal language of logic but from our natural language and the presumptions implicit in it. In natural language, we tend to use “if … then” in different ways in different contexts without careful discrimination. Often, we presume there to exist some meaningful real- world context that relates the antecedent and consequent, and often there is a presumption of causality involved; i.e., a presumption the antecedant causes the consequent. However, real-world context or causality has nothing to do with material implication, which relates truth values and nothing more. Understanding Implication There exist extensions of propositional logic that introduce connectives permitting possible relatedness between antecedents and consequents to be addressed. Such extended logics generally include propositional logic as a subset, and thus include the material implication among their connectives, but they also permit generalizations of it that allow some of the more “natural” expectations about implication to be formalized. “Vacuous truth” does not go away; material implication continues to “mean” exactly what it means in propositional logic. Understanding Implication redux Meaning: p q p→q T T T ← It is true that T → T T F F ← It is false that T → F F T T ← It is true that F → anything F F T (Get used to it!) Converse Implication p←q Converse – “Only if” p q p←q “Only if” is false only when the antecedent T T T p is false and the consequent q is true T F T Also: F T F “if q then p” “converse implication” F F T Other Connectives NAND “” Because negation is simple to notate, these are not so important in basic logic; • ~ (p q) however … NOR “” NAND and NOR are important in computer • ~ (p q) science XOR “” Natural language “or” is sometimes “OR”, • ~ (p ↔ q) sometimes “XOR” Order of Precedence 1st ~p negation 2nd p q conjunction (and) 3rd p q disjunction (or) 4th p →q implication 5th p ↔q equivalence Random example: { [ (~p) (~q) ] (p → r) } ↔ (p → s) ~p ~q (p → r) ↔ p → s Four forms of Implication From any two statements p and q, there are four related implications that can be formed: p→q < Converses > q→p implication converse Note that none of Inverses ↕ these are negations ↕ Inverses ~p → ~q < Converses > ~q → ~p inverse contrapositive Diagonals are equivalent: ( p → q ) ↔ ( ~q → ~p ) ( q → p ) ↔ ( ~p → ~q ) Consolidated Truth Table for Conditionals p q p→q q→p ~p → ~q ~q → ~p implication converse inverse contrapositive T T T T T T T F F T T F F T T F F T F F T T T T (Note that none of these four is a negation of any other.) Consolidated Truth Table for Conditionals p q p→q q→p ~p → ~q ~q → ~p implication converse inverse contrapositive T T T T T T T F F T T F F T T F F T F F T T T T (Note that none of these four is a negation of any other.) Consolidated Truth Table for Conditionals p q p→q q→p ~p → ~q ~q → ~p implication converse inverse contrapositive T T T T T T T F F T T F F T T F F T F F T T T T (Note that none of these four is a negation of any other.) Consolidated Truth Table for Conditionals p q p→q q→p ~p → ~q ~q → ~p implication converse inverse contrapositive T T T T T T T F F T T F F T T F F T F F T T T T (Note that none of these four is a negation of any other.) Consolidated Truth Table for Conditionals p q p→q q→p ~p → ~q ~q → ~p implication converse inverse contrapositive T T T T T T T F F T T F F T T F F T F F T T T T (Note that none of these four is a negation of any other.) Consolidated Truth Table for Conditionals p q p→q q→p ~p → ~q ~q → ~p implication converse inverse contrapositive T T T T T T T F F T T F F T T F F T F F T T T T ( p → q ) ↔ ( ~q → ~p ) Consolidated Truth Table for Conditionals p q p→q q→p ~p → ~q ~q → ~p implication converse inverse contrapositive T T T T T T T F F T T F F T T F F T F F T T T T ( q → p ) ↔ ( ~p → ~q ) iff p q p→q p←q (p → q) (p ← q) p↔q implication converse If and only if equivalence T T T T T T T F F T F F F T T F F F F F T T T T (p → q) (p ← q) ↔ (p ↔ q) iff p q p→q p←q (p → q) (p ← q) p↔q implication converse If and only if equivalence T T T T T T T F F T F F F T T F F F F F T T T T (p → q) (p ← q) ↔ (p ↔ q) iff p q p→q p←q (p → q) (p ← q) p↔q implication converse If and only if equivalence T T T T T T T F F T F F F T T F F F F F T T T T (p → q) (p ← q) ↔ (p ↔ q) iff p q p→q p←q (p → q) (p ← q) p↔q implication converse If and only if equivalence T T T T T T T F F T F F F T T F F F F F T T T T (p → q) (p ← q) ↔ (p ↔ q) iff p q p→q p←q (p → q) (p ← q) p↔q implication converse If and only if equivalence T T T T T T T F F T F F F T T F F F F F T T T T (p → q) (p ← q) ↔ (p ↔ q) iff p q p→q p←q (p → q) (p ← q) p↔q implication converse If and only if Equivalence T T T T T T T F F T F F F T T F F F F F T T T T (p → q) (p ← q) ↔ (p ↔ q) “Normal Forms” of Implication and Equivalence Implication and equivalence both can be reduced to useful expressions containing only the connectives ~, , and . (Check the truth tables!) (p → q) ↔ (~p q) (p ↔ q) ↔ (p q) (~p ~q) RHSs are in “disjunctive normal form”. Any expression of propositional logic can transformed into “disjunctive normal form” and also “conjunctive normal form”. Any two propositions sharing the same normal form are equivalent. End of Part 1