Logic and Proofs. (A brief summary)

Similar documents
Logic and Proofs. (A brief summary)

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Chapter 4, Logic using Propositional Calculus Handout

Logic Overview, I. and T T T T F F F T F F F F

Logic, Sets, and Proofs

Propositional Logic. Spring Propositional Logic Spring / 32

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

Mat 243 Exam 1 Review

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

HANDOUT AND SET THEORY. Ariyadi Wijaya

Introduction to Sets and Logic (MATH 1190)

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

Chapter 1 Elementary Logic

CSC Discrete Math I, Spring Propositional Logic

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

A. Propositional Logic

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

The Logic of Compound Statements cont.

DISCRETE MATH: FINAL REVIEW

Compound Propositions

First order Logic ( Predicate Logic) and Methods of Proof

Logic and Proof. Aiichiro Nakano

2.2: Logical Equivalence: The Laws of Logic

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

Packet #1: Logic & Proofs. Applied Discrete Mathematics

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

What is the decimal (base 10) representation of the binary number ? Show your work and place your final answer in the box.

Chapter 1: The Logic of Compound Statements. January 7, 2008

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

1.1 Language and Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

MCS-236: Graph Theory Handout #A4 San Skulrattanakulchai Gustavus Adolphus College Sep 15, Methods of Proof

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Proofs. Joe Patten August 10, 2018

Logic and Propositional Calculus

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

A statement is a sentence that is definitely either true or false but not both.

Introduction to Decision Sciences Lecture 2

1.1 Language and Logic

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Manual of Logical Style

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Intro to Logic and Proofs

MAI0203 Lecture 7: Inference and Predicate Calculus

1 The Foundation: Logic and Proofs

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Proofs: A General How To II. Rules of Inference. Rules of Inference Modus Ponens. Rules of Inference Addition. Rules of Inference Conjunction

Definition 2. Conjunction of p and q

Discrete Mathematics. Instructor: Sourav Chakraborty. Lecture 4: Propositional Logic and Predicate Lo

CHAPTER 1. MATHEMATICAL LOGIC 1.1 Fundamentals of Mathematical Logic

PROPOSITIONAL CALCULUS

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

Logic: Propositional Logic (Part I)

Propositional logic (revision) & semantic entailment. p. 1/34

Predicate Logic. Andreas Klappenecker

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

software design & management Gachon University Chulyun Kim

1 The Foundation: Logic and Proofs

1.1 Statements and Compound Statements

MAT2345 Discrete Math

Chapter 2: The Logic of Quantified Statements

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Mathematical Reasoning (Part I) 1

Propositional Logic Not Enough

CSE 20. Final Review. CSE 20: Final Review

02 Propositional Logic

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Section 1.2: Propositional Logic

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Learning Goals of CS245 Logic and Computation

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

Logic and Propositional Calculus

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 1

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Logic. Propositional Logic: Syntax

Propositional Logic Logical Implication (4A) Young W. Lim 4/21/17

cis32-ai lecture # 18 mon-3-apr-2006

Proofs. Introduction II. Notes. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

Handout on Logic, Axiomatic Methods, and Proofs MATH Spring David C. Royster UNC Charlotte

Analysis 1. Lecture Notes 2013/2014. The original version of these Notes was written by. Vitali Liskevich

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

Transcription:

Logic and Proofs (A brief summary) Why Study Logic: To learn to prove claims/statements rigorously To be able to judge better the soundness and consistency of (others ) arguments To gain the foundations of how to program (teach) computers to reason. That is called automated reasoning, which is part of Artificial intelligence (AI). Propositions: A proposition is a declarative statement (sentence) that is true or false. For example, Mars is a planet is a proposition that is true, and Jupiter is a star is a proposition that is false. Questions, commands and exclamations are examples of sentences that are not propositions. Truth values: They are the values true (denoted T) and false (denoted F). A proposition that conveys a single fact is called a simple proposition. Simple propositions can be combined and/or negated, using so-called logical connectives, to form more elaborate propositions called compound propositions. Logical connectives: They are the logical operations and, or, and not. The first two are binary operations, that is, they take two operands where each operand is a proposition. The not is a unary operation in that it takes a single operand. Examples of compound propositions: o Mars is a planet and Jupiter is a star o Mars is a planet or Jupiter is a star o not (Jupiter is a star). In plain English, this statement means Jupiter is not a star. o Mars is a planet and (Jupiter is a star or not(pluto is a comet)) Notations: o The operation and is denoted. (In Boolean algebra, it is denoted by the dot. ). o The operation or is denoted. (In Boolean algebra, it is denoted by + ). o The operation not is denoted, ~, (overbar), or. Logic is concerned much more about the truth values of propositions than about their meanings. Therefore, and for convenience and efficiency, propositions are often denoted with single-letter symbols such as p, q, r, etc. And the focus is on whether a proposition p is true or false, rather than on what p means/designates. For example, we can denote Mars is a planet by p, Jupiter is a star by q, and Pluto is a comet by r. Then the above examples of compound statements can be succinctly represented as: o Mars is a planet and Jupiter is a star :. This (i.e., ) is called a conjunction. o Mars is a planet or Jupiter is a star :. This (i.e., ) is called a disjunction. o not (Jupiter is a star) :, ~,, or. 1

Truth Tables: o Mars is a planet and (Jupiter is a star or not(pluto is a comet)) :. A truth table for a compound proposition gives the truth value of the proposition for each possible combination of the truth values of the simple propositions that make up the compound proposition. Truth tables have many applications, including determining (1) when a proposition is true, (2) whether two propositions are logically equivalent, (3) when a given proposition implies another given proposition, (4) constructing and optimizing digital circuits (hardware), etc. The most basic truth tables, which form our foundation of logic and reasoning, are the truth tables for the three logical connectives: p q T T T T F F F T F F F F p q T T T T F T F T T F F F Examples of truth tables: o Truth table for : The table will list the 8 different combinations of the truth values of the propositions p, q and r. Also, because it needs the values, a separate column will be added to the table for. Finally, to fill the column of, we apply the operation to the column of p and the column of : p q r T T T T T T T F T T T F T T T T F F F F F T T T F F T F T F F F T T F F F F F F p T F F T o Truth table for : p q r T T T T T T T T F T F T T F T F T T T F F F F F F T T F F F F T F F F F F F T T F F F F F F F F 2

Equivalence of two propositions (a first look): Note that the column of and the column of are identical, thus indicating that those two propositions are equivalent, meaning that they have the same truth values for the same combinations of truthvalues of the simple propositions that make them up. In fact, that s one basic way to show that two different propositions are equivalent: o Build a truth table for each proposition, and then observe if the two columns of the two propositions are identical (make sure that the combinations of the truth-values are listed in the same order in both tables). Note that to save time and space, the two tables can be combined into a single table, as follows: p q r T T T T T T T T T T F T T F T T T F T T F T T T T F F F F F F F F T T T F F F F F T F T F F F F F F T T F F F F F F F F F F F F Another example: Showing equivalence of and : p q r T T T T F F F F T T F T F F F F T F T F F T T T T F F F F T T T F T T F T F T T F T F F T F T T F F T F T T T T F F F F T T T T Looking at the two rightmost columns, we find them to be identical, thereby proving that and are logically equivalent. Predicates: Predicates generalize propositions to include quantification, that is, the phrases for every and there exists, and thereby increase the expressive and reasoning power of logic. Universal quantifier: It is the phrase for every (or for all ), and it is denoted. Existential quantifier: It is the phrase there exists or there is (at least), and is denoted. 3

Example: Consider the English sentence every rational number is a fraction of two integers, which is equivalent to the more detailed sentence for every rational number x, there exists an integer m and there exists an integer n such that. That sentence can be written more formally (and more succinctly) as:. An alternative form is:,,,. Predicate: A predicate is a proposition that involves one or more quantifier. Examples of predicates: o Some natural numbers are prime numbers: is prime. Note: that is true o Every natural number is prime: is prime. Note: that is false o Between every two distinct real numbers there is at least one rational number: y. Or equivalently:. o For every integer n, n(n+1) is even: 1 is even. Note that sometimes a predicate is written semi-formally such as: integer 1 is even, or: integer, 1 is even. o All humans are mortal: human is mortal, or: human, is mortal. General form of predicates: From the above examples, we can see that each predicate is for the form: o x A(P(x)) Notes: P(x) is a proposition involving the variable x, and A is some defined set called the domain of x. Such a predicate is called an existential statement/predicate, and it is True if there is at least one element x in the set A that would make the sentence P(x) True. o x A(P(x)), or simply: x A, P(x) Notes: Such a predicate is called a universal statement/predicate. It is true if P(x) is true for every element x in the domain A. o x A y B(P(x,y)) Note: P(x,y) is a proposition involving variables x and y. It is true if for every element x in A, we can find at least element y in B (where y depends on x), such that P(x,y) is true. o Generally, a predicate is of the form,,, where each is or, and,,, is a simple/compound proposition involving the variables,,,, and can be an implication or an equivalence. Logical Rules of Reasoning: At the foundation of formal reasoning and proving lie basic rules of logical equivalence and logical implications. The following tables summarize those rules. Note that all of those rules can be proved using truth tables. 4

Logical Equivalences Definition: Two propositions/predicates p and q are said to be equivalent (denoted ) if whenever p is true, q is true, and vice versa. (Sometimes people use or iff or even =, when they mean ) Let p, q, and r be three arbitrary propositions/predicates. The following logical equivalences hold: 1. Commutative laws: 2. Associative laws: 3. Distributive laws: 4. Identity laws: 5. Complementation laws: 6. Double negative laws: 7. Idempotent laws: 8. Universal bound laws: 9. De Morgan s laws: 10. Absorption laws: 11. Negations of T and F: Definitions: A conditional implication, denoted, is by definition. That is,. A tautology is a proposition/predicate that is always true. For example, is a tautology. Logical implication: If is a tautology, we say that p logically implies q, or simply p implies q, and denote it. In other terms, if (whenever p is true, q must be true). Logical Implications Rules: 1. Specialization: 2. Generalization: 3. Elimination: 4. Transitivity: 5. Contrapositive: 6. Modus Ponens: 7. Modus Tollens: 8. Contradiction rule: [to prove p, assume and derive something false] 9. Division into cases: 10. 11. 12. How to prove an implication rule: to prove that for some proposition P and some proposition Q, build the truth table for (that is, for ), and show that the column under is all T. Example: show that. 5

How to prove an equivalence rule/law: to prove an equivalence rule for some proposition P and some proposition Q, build the truth table for and, and show that the columns of and are identical. This was illustrated earlier. Rules of Predicate Logic: 1. AP AP 2. AP AP 3. AP AP 4.,,,,,,, where each is or, and where and. Converse, inverse, and contrapositive: The converse of is. The converse of is. Note that if, it does not follow that its converse holds. The inverse of is. The inverse of is. Note that if, it does not follow that its inverse holds. The contrapositive of is. The contrapositive of is. Note that if, then its contrapositive must hold (the contrapositive rule). Definition of a proof: A proof is a sequence of steps from given/known propositions (called assumptions or premises or hypotheses) to a final proposition (called conclusion), where every step is an implication. Types of proofs: Let P and Q be two propositions/predicates, and suppose we wish to prove. There are several types of proof for : Direct proof: It is of the form where each implication is one of the rules of implication or a previously proved implication. This works because of transitivity of implication. Indirect proof: o Proof by contradiction: Assume is true, and derive (from P and ) a false statement through a sequence of implications. This works because of the contradiction rule. o Contrapositive proof: Prove that. This works because of the contrapositive rule. Proof by a counterexample: Suppose we wish to prove AP is false. It is enough to prove that AP is true, which is equivalent to proving that A P is true. The latter means that we need (and it is sufficient) to find just one specific element x in A such that P(x) is false. The element x is called a counterexample. Thus, a proof of AP is false by a counterexample entails finding just one specific element x in A such that P(x) is false. o Exercise: Prove the following is not true: positive integer, 4 1 is a prime number. 6

Proof of a declarative statement or a predicate: Let Q be a declarative statement or a predicate, and suppose we are asked to prove Q to be true. Examples of Q: 11 is prime, set, 2 2, etc. o Proof ofq when Qis a declarative statement, not a predicate: use the definitions and properties of the terms in Q as your premises, and prove that those premises imply Q. o Proof of Q when Q is a universal predicate of the form AP: Take x as an arbitrary element of A (don t take examples or specific elements of A), and use the definition/properties of the domain A as your premises, and prove that those premises imply Q. o Proof of Q when Q is an existential predicate of the form AP: Find a specific element x in the domain A for which the proposition/predicate P is true. Proof by induction: To be explained in a later lesson. Proof of equivalence: Let P and Q be two propositions/predicates, and we wish to prove. There are two broad approaches: Direct approach: It is of the form where each equivalence is one of the equivalence laws or a previously proved equivalence. By two implications: Prove and. Some fine points and additional notations: If, we say: o Q is a necessary condition for P o P is a sufficient condition for Q o Q is true if P is true (or: if P, then Q). o P is true only if Q is true. Example: We know that: an integer n is divisible by 6 n is divisible by 3. Clearly, divisibility by 3 is a necessary condition for divisibility by 6 (i.e., without being divisible by 3, an integer cannot be divisible by 6). Similarly, divisibility by 6 is a sufficient condition for divisibility by 3. Also, an integer is divisible by 6 only if it is divisible by 3. If and only if (iff) o We say P is true if and only if Q is true to mean the same thing as P is equivalent to Q, i.e.,. Necessary and sufficient conditions: When, we can say that Q is a necessary and sufficient condition for P. For example, divisibility by both 3 and 2 is a necessary and sufficient condition for divisibility by 6; that is because an integer is divisible by 6 if and only if it is divisible by both 3 and 2. Notation for therefore : Paradox: A paradox is a statement that contradicts itself (e.g., if it is true, then it is false, and if it is false, then it is true!). Examples: o This statement is false o The next statement is true. The previous statement is false. 7