Propositional Logic Spring 2016 Propositional Logic Spring 2016 1 / 32
Introduction Learning Outcomes for this Presentation Learning Outcomes... At the conclusion of this session, we will Define the elements of propositional logic: statements and operations, including implication, and its converse, inverse, and negation. Translate English expressions into logical statements. Use both truth tables and derivations to demonstrate equivalence of logical statements. Define common tautologies, contradictions, and equivalences. Recognize and employ modus ponens and modus tollens and other forms of valid argumentation. Propositional Logic Spring 2016 2 / 32
Introduction Learning Outcomes for this Presentation It s difficult, and possibly counterproductive, to provide a concise description of logic... What is logic? Why is it important? How will we use it in this class? Propositional Logic Spring 2016 3 / 32
Introduction Learning Outcomes for this Presentation It s difficult, and possibly counterproductive, to provide a concise description of logic... What is logic? A formal system for expressing truth and falsity. Why is it important? How will we use it in this class? Propositional Logic Spring 2016 3 / 32
Introduction Learning Outcomes for this Presentation It s difficult, and possibly counterproductive, to provide a concise description of logic... What is logic? A formal system for expressing truth and falsity. Why is it important? Provides a method of reasoning from given truths (called axioms) to new truths (called propositions or theorems). How will we use it in this class? Propositional Logic Spring 2016 3 / 32
Introduction Learning Outcomes for this Presentation It s difficult, and possibly counterproductive, to provide a concise description of logic... What is logic? A formal system for expressing truth and falsity. Why is it important? Provides a method of reasoning from given truths (called axioms) to new truths (called propositions or theorems). How will we use it in this class? Logic is the skeleton that supports mathematical truth-making, i.e., proof-reading and proof-writing. Propositional Logic Spring 2016 3 / 32
Introduction Learning Outcomes for this Presentation It s difficult, and possibly counterproductive, to provide a concise description of logic... What is logic? A formal system for expressing truth and falsity. Why is it important? Provides a method of reasoning from given truths (called axioms) to new truths (called propositions or theorems). How will we use it in this class? Logic is the skeleton that supports mathematical truth-making, i.e., proof-reading and proof-writing. Logic is the glue that holds computers and programs together. Propositional Logic Spring 2016 3 / 32
Definitions Statements Propositional statements Definition A statement is a declaration in a language that is either true or false. Example It is raining is an atomic statement, as is The sun in shining. Two compound statements can for formed from these: (1) It is raining or the sun is shining ; and (2) It is raining and the sun is shining. Propositional Logic Spring 2016 4 / 32
Definitions Logical connectives Making new statements by connecting propositions Three fundamental operators are adequate to create the spectrum of logical possibilities. Operator And (conjunction) Or (disjunction) Negation Description Written s t: true when s and t are true. Written s t: true when s or t are true. Written s (or sometimes s): true only when s is false, and vice versa. Keep in mind that s and t may be atomic or compound propositions themselves! Propositional Logic Spring 2016 5 / 32
Definitions Logical connectives Truth tables... The meaning of a logical operation can be expressed as its truth table. Construct the truth-table for conjunction: Construct the truth-table for disjunction; Construct the truth-table for negation. Do in class Propositional Logic Spring 2016 6 / 32
Definitions Interpretations, contexts,... Truth, falsity, and interpretations Example The truth or falsity of any statement depends upon its context. Context can be visualized as the values that are associated with each variable in a statement. Is a b true? Well, if either a = true or b = true, then the statement a b is true. Ask now if a b is true, and you will see that it is true, but under fewer interpretations or, its context is different. Propositional Logic Spring 2016 7 / 32
Definitions Logically equivalent statements Logical equivalences How could we show if two logical statements are equivalent? Construct truth tables for each. We will demonstrate other methods shortly but these methods depend upon the truth tables of the underlying operations. Propositional Logic Spring 2016 8 / 32
Definitions Logically equivalent statements A worked example Example Let s be The sun is shining and t be It is raining. Join these into the compound statement: ( s t) t. 1 Try to phrase the compound statement in English: 2 Construct the truth table for ( s t) t Example to be done in class. Propositional Logic Spring 2016 9 / 32
Definitions Logically equivalent statements Using a truth table to illustrate a common usage... The word or is often used to mean one or the other, but this is not the same meaning of or in logic! Definition The exclusive-or of two statements p and q (written p q), is true only when either p is true or q is true, but not both. Use instead: (p q) (p q) p q and (p q) (q p) p q Show in class Propositional Logic Spring 2016 10 / 32
Definitions Logically equivalent statements De Morgan s laws... A well-known and often-used pair of laws based upon the distributive and the negation properties from your text: Definition De Morgan s Laws state that for any statements p and q: (p q) p q (p q) p q. and De Morgan s laws simplify computer programs. De Morgan s laws simplify circuit designs. Propositional Logic Spring 2016 11 / 32
Definitions Logically equivalent statements Because it s that important! How do we know that DeMorgan s laws (or any laws) are valid? Thought experiment: Apart from the truth table just constructed, can you think of any other mathematically sound way to prove or show that De Morgan s laws are always valid? Propositional Logic Spring 2016 12 / 32
Definitions Logically equivalent statements Because it s that important! How do we know that DeMorgan s laws (or any laws) are valid? Construct the truth-tables and verify on your own! Thought experiment: Apart from the truth table just constructed, can you think of any other mathematically sound way to prove or show that De Morgan s laws are always valid? Propositional Logic Spring 2016 12 / 32
Logical implication Introducing logical implication Example Arguably, logical implication is the most useful operator in predicate logic. Logical implication is expressible using only two of the operators introduced in the last slide. Implication captures the notion of an action depending upon the success (or failure) of another action. Unlike primitive connectors, implication is directional! If it rains, then Richard brings an umbrella. We would like a way of assigning truth or falsity to these kinds of statements. Propositional Logic Spring 2016 13 / 32
Logical implication Implication, cont d. Examine the truth table for the implication a b: a b a b T T T F T T T F F F F T Note two important qualities of implication: 1 We see only one case where the implication is false. 2 Compare rows 2 and 3: implication is sensitive to direction!. Propositional Logic Spring 2016 14 / 32
Logical implication Implications of implication... Everything to the left of the implication symbol is called either the antecedent, or the hypothesis. Everything to the right of the implication symbol is called the consequent, or the conclusion, Propositional Logic Spring 2016 15 / 32
Logical implication Implications of implication... Everything to the left of the implication symbol is called either the antecedent, or the hypothesis. Everything to the right of the implication symbol is called the consequent, or the conclusion, Unlike in common speech, no relationship need exist between the hypothesis and the conclusion. 1 If the sky is blue then 5 is prime 2 If the moon is made of cheese, then then 5 is prime. and, 3 If the moon is made of cheese, then 5 is not prime. Propositional Logic Spring 2016 15 / 32
Logical implication Trying on a few implications... See how well you do with these: Identify the hypotheses and the conclusions. State under which circumstances these implications are true and under which they are false: 1 If oxygen is present, then rust will form. 2 Only if I study hard will I pass this course. (Read this as p, only if q.) 3 If f (x) = f (y) then x = y. 4 If x y then f (x) f (y). Propositional Logic Spring 2016 16 / 32
Logical implication Variations on implication Some important variations of implications We will consider the following variations of implication: Define the negation of an implication: Define the converse of an implication. Define the inverse of an implication. Define the contrapositive. Example We will use this statement for all of our examples: If I live in College Park, then I live in Maryland. Propositional Logic Spring 2016 17 / 32
Logical implication Variations on implication Negating an implication Definition The negation of an implication p q is obtained by negating it. Example Given p q, its negation is p q. The negation of an implication is not another implication. Show this now. Propositional Logic Spring 2016 18 / 32
Logical implication Variations on implication The converse of an implication Definition The converse of an implication is obtained by transposing its conclusion with its premise. Example Given p q, its converse is q p. Propositional Logic Spring 2016 19 / 32
Logical implication Variations on implication The inverse of an implication Definition The inverse of an implication is obtained by negating both its premise and its conclusion. Example Given p q, its inverse is ( p) ( q). (Parentheses added for emphasis.) Propositional Logic Spring 2016 20 / 32
Logical implication Variations on implication The Contrapositive form of an implication Definition The contrapositive is formed by inverting its converse. Given p q, form its contrapositive as q p. Do in class Propositional Logic Spring 2016 21 / 32
Bidirectional implication Bidirectional implication Definition The biconditional statement is an implication that is true only when its antecedent and its consequent have the same truth values; it is false otherwise. In symbols, p q is true only when p q and q p. p q p q T T T T F F F T F F F T Propositional Logic Spring 2016 22 / 32
Bidirectional implication Experimenting with bi-conditionals... The bi-conditional, arguably, corresponds to the common use of the word if in English sentences. The bi-conditional sometimes appears in scientific or technical text as iff or as a necessary and sufficient condition. What do the converse, inverse, and negations of a bi-conditional look like? What is the relationship between the exclusive-or (discussed above) and the bi-conditional? Propositional Logic Spring 2016 23 / 32
Valid and Invalid Arguments Definition Validity, as a matter of form. Definition An argument is a sequence of statements terminating with a conclusion. Validity is based upon formal properties, not content. Mastery of logical argumentation translates into a deeper understanding of, and facility for, constructing mathematical proof. Propositional Logic Spring 2016 24 / 32
Forms of Argumentation Truth in logic... What does it mean for the logical statements that interest this class to be true? Example If the sum the digits of a number is divisible by 3, then the number itself is divisible by 3. For the moment: we will restrict our attention to propositional logic. We have a method for determining the truth of these kinds of propositional statements. Propositional Logic Spring 2016 25 / 32
Forms of Argumentation Truth in logic... Example What does it mean for the logical statements that interest this class to be true? They commonly appear as a set of assumptions (hypotheses) and a conclusion that we wish to show follows from these. If the sum the digits of a number is divisible by 3, then the number itself is divisible by 3. For the moment: we will restrict our attention to propositional logic. We have a method for determining the truth of these kinds of propositional statements. Propositional Logic Spring 2016 25 / 32
Forms of Argumentation A complete example Valid Statement : If p q, p r, and q r then p. p q r p q p r q r p T T T T T T T T T F T T F T T F T T T T T T F F T T T T F T T T F T F F T F T T F F F F T F F T F F F F F T T F Propositional Logic Spring 2016 26 / 32
Forms of Argumentation Slightly modified... Invalid Statement : If p q, p r, and q r then r. p q r p q p r q r r T T T T T T T T T F T T F F T F T T T T T T F F T T T F F T T T F T T F T F T T F F F F T F F T T F F F F T T F Propositional Logic Spring 2016 27 / 32
Forms of Argumentation Common forms of argument Proofs: Using inference... Here are some common patterns from your text: Modus ponens (To prove by asserting.) p q, p. q p q, q Modus tollens (To prove by denying.). p p q, q p q, p Disjunctive syllogism ; likewise. p q Rule of contradiction Let c be a contradiction: p c. p The remaining rules can be derived by systematically applying the rules above with the basic properties of a boolean algebra, i.e., associativity, commutativity, idempotence, etc. Propositional Logic Spring 2016 28 / 32
Forms of Argumentation Common forms of argument General Laws of Propositional Statements Given any statement variables p, q, and r, a tautology t and a contradiction c, the following logical equivalences hold: 1. Commutative laws: p q q p p q q p 2. Associative laws: (p q) r p (q r) (p q) r p (q r) 3. Distributive laws: p (q r) (p q) (p r) p (q r) (p q) (p r) 4. Identity laws: p t p p c p 5. Negation laws: p p t p p c 6. Double Negative law: ( p) p 7. Idempotent laws: p p p p p p 8. DeMorgan s laws: (p q) p q (p q) p q 9. Universal bounds laws: p t t p c c 10. Absorption laws: p (p q) p p (p q) p 11. Negations of t and c: t c c t Propositional Logic Spring 2016 29 / 32
Forms of Argumentation Common forms of argument Common forms of argumentation Modus Ponens Modus Tollens Disjunctive p q p q p q p q Syllogism q p p q Therefore p Therefore q Therefore q Therefore p Conjunctive p Hypothetical p q Addition q Syllogism q r Therefore p q Therefore p r Disjunctive p q Dilemma: p q Addition Therefore p q Therefore p q Proof by p r Division q r into Cases Therefore r Conjunctive p q p q Rule of p c Simplification Therefore p Therefore q Contradiction Therefore p Closing C.W. p Assumed Closing C.W. p Assumed without q derived with x x derived contradiction Therefore p q contradiction Therefore p Propositional Logic Spring 2016 30 / 32
Summary & Moving Forward Reviewing & moving forward Statements may be atomic or compound. Their syntax is unambiguous. Propositional Logic Spring 2016 31 / 32
Summary & Moving Forward Reviewing & moving forward Statements may be atomic or compound. Their syntax is unambiguous. Statements are combined by logical operators: three primitive operators are negation, disjunction, and conjunction. Propositional Logic Spring 2016 31 / 32
Summary & Moving Forward Reviewing & moving forward Statements may be atomic or compound. Their syntax is unambiguous. Statements are combined by logical operators: three primitive operators are negation, disjunction, and conjunction. These operators have certain properties: they are commutative, associative,..., directionless. Propositional Logic Spring 2016 31 / 32
Summary & Moving Forward Reviewing & moving forward Statements may be atomic or compound. Their syntax is unambiguous. Statements are combined by logical operators: three primitive operators are negation, disjunction, and conjunction. These operators have certain properties: they are commutative, associative,..., directionless. Logical implication is constructed. Unlike its components, implications have direction. Propositional Logic Spring 2016 31 / 32
Summary & Moving Forward Reviewing & moving forward Statements may be atomic or compound. Their syntax is unambiguous. Statements are combined by logical operators: three primitive operators are negation, disjunction, and conjunction. These operators have certain properties: they are commutative, associative,..., directionless. Logical implication is constructed. Unlike its components, implications have direction. Arguments are patterns of reasoning that incorporate these operators over a particular domain of discourse, e.g., numbers, objects, etc. Propositional Logic Spring 2016 31 / 32
Summary & Moving Forward Reviewing & moving forward Statements may be atomic or compound. Their syntax is unambiguous. Statements are combined by logical operators: three primitive operators are negation, disjunction, and conjunction. These operators have certain properties: they are commutative, associative,..., directionless. Logical implication is constructed. Unlike its components, implications have direction. Arguments are patterns of reasoning that incorporate these operators over a particular domain of discourse, e.g., numbers, objects, etc. Most importantly: truth is formal in these sytems. Propositional Logic Spring 2016 31 / 32
Summary & Moving Forward Applications of logic Logic is everywhere. Shortly, we will examine how logic is used in several areas relevant to computer science. Logical primitives & switching circuits. Logical statements & sequential circuits. Later in this semester, perhaps Logical constructions in combinatorial circuits. Propositional Logic Spring 2016 32 / 32