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.

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

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

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

CSC Discrete Math I, Spring Propositional Logic

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

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

1 The Foundation: Logic and Proofs

1 The Foundation: Logic and Proofs

Manual of Logical Style

Logic and Proof. Aiichiro Nakano

Propositional Logic. Spring Propositional Logic Spring / 32

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.

PROPOSITIONAL CALCULUS

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

Supplementary Logic Notes CSE 321 Winter 2009

1.1 Statements and Compound Statements

1.1 Language and Logic

CSE 20 DISCRETE MATH. Winter

Section 1.2: Propositional Logic

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

CSE 20 DISCRETE MATH. Fall

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Predicate Logic. Andreas Klappenecker

Chapter 1 Elementary Logic

1.1 Language and Logic

Compound Propositions

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

Section 1.1 Propositions

Mat 243 Exam 1 Review

2.2: Logical Equivalence: The Laws of Logic

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

software design & management Gachon University Chulyun Kim

Proofs. Example of an axiom in this system: Given two distinct points, there is exactly one line that contains them.

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

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

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Readings: Conjecture. Theorem. Rosen Section 1.5

Math 3336: Discrete Mathematics Practice Problems for Exam I

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

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

15414/614 Optional Lecture 1: Propositional Logic

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

The Logic of Compound Statements cont.

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

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

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

Introduction to Decision Sciences Lecture 2

Logic, Sets, and Proofs

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

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

A. Propositional Logic

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide

Proof strategies, or, a manual of logical style

Discrete Mathematics and Its Applications

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

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

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

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

3 The Semantics of the Propositional Calculus

Manual of Logical Style (fresh version 2018)

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

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

Logic and Propositional Calculus

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

Propositional Logic. Fall () Propositional Logic Fall / 30

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

Gödel s Incompleteness Theorems by Sally Cockburn (2016)

Language of Propositional Logic

Proofs. Joe Patten August 10, 2018

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

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

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

THE LOGIC OF COMPOUND STATEMENTS

Math 300 Introduction to Mathematical Reasoning Autumn 2017 Proof Templates 1

Logic - recap. So far, we have seen that: Logic is a language which can be used to describe:

Introduction to Sets and Logic (MATH 1190)

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

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

Methods of Proof. 1.6 Rules of Inference. Argument and inference 12/8/2015. CSE2023 Discrete Computational Structures

Review for Midterm 1. Andreas Klappenecker

MAT 243 Test 1 SOLUTIONS, FORM A

Truth-Functional Logic

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

COMP 2600: Formal Methods for Software Engineeing

Chapter 4, Logic using Propositional Calculus Handout

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/33

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

It rains now. (true) The followings are not propositions.

Outline. Rules of Inferences Discrete Mathematics I MATH/COSC 1056E. Example: Existence of Superman. Outline

Intro to Logic and Proofs

Rules Build Arguments Rules Building Arguments

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

Full file at

Logic and Proofs. (A brief summary)

4 Derivations in the Propositional Calculus

Section 3.1: Direct Proof and Counterexample 1

CSCE 222 Discrete Structures for Computing. Propositional Logic. Dr. Hyunyoung Lee. !!!!!! Based on slides by Andreas Klappenecker

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

Transcription:

Math 0413 Appendix A.0 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. This type of logic is called propositional. Definition statement). A sentence with truth value (True/False, T/F) is called a proposition (or a Types of mathematical operations: Nullary. It has no arguments. Unary. It has one argument. Arithmetic examples: a, 1/a. Binary. It has two arguments. Arithmetic examples: a + b, a b, a b, a b, a b. Ternary. It has three arguments. n-ary. It has n arguments. Many mathematical operations can be treated as functions of the corresponding number of arguments. For example, in Arithmetic the addition a + b, being a binary operation, can be defined as a function of two arguments (variables) f(a, b) = a + b. In logic arguments of a function are propositions. The domain of the function is finite and made of all possible combinations of truth values (T and F) of corresponding propositions. It is discrete and finite. The range of a function is either T, or F, or both T and F. The range is also discrete and finite. Because domain and range both are finite the total number of possible functions has to be finite. The following examples explain the concept. Example 1. Consider a proposition P. We want to define the set of all functions of P. The proposition P has two truth values T and F. The list of all possible truth values is T and F. So, the domain of a function is a set of two values. Each function has to be defined at these two values. For example, two possible functions are f 1 (T ) = T, f 1 (F ) = T and f 2 (T ) = T, f 2 (F ) = F. These functions are different since f 1 (F ) f 2 (T ). What is the total number of functions of P? For each of two truth values in the domain there are two truth values in the range. The total number of combinations is 2 2 = 4. Therefore, there are four different functions of one argument P. The following table lists all of them 1

P f 1 f 2 f 3 f 4 T T T F F F T F T F Example 2. Consider two propositions P and Q and all functions f(p, Q). Each of propositions has two truth values T and F. The list of all possible combinations (pairs) of truth values for P and Q is (T,T), (T,F), (F,T), and (F,F). So, the domain of a function of P and Q is a set of four pairs of truth values. Each function has to be defined at these pairs. For each of four pairs in the domain there are two values in the range. The total number of possible combinations is 2 4 = 16. Therefore, there are sixteen different functions of two arguments P and Q. Example 3. Consider three propositions P, Q, and R and all functions f(p, Q, R). Each of propositions has two truth values T and F. The list of all possible combinations (triplets) of truth values is (T,T,T), (T,T,F), (T,F,T), (T,F,F), (F,T,T), (F,T,F), (F,F,T), and (T,F,F). So, the domain of a function is a set of eight triplets. For each of eight values in the domain there are two values in the range. The total number of possible combinations is 2 8 = 256. Therefore, there are 256 different functions of three propositions. Now let s analyze types of operations in terms of functions. Unary Unary operation is a function of one proposition P. As it was shown above there are four such functions. Let s look at their table again and emphasize a nontrivial function: P f 1 f 2 f 3 f 4 T T T F F F T F T F The functions f 1 and f 4 are constant (f 1 = T, f 4 = F ) and hence trivial. The function f 2 is also trivial since f 2 (P ) = P. The only nontrivial function of one argument is f 3 and hence it is special. In logic it is called negation and denoted by P (or P ). Please remember this function. 2

Binary It is defined on the four pairs of truth values of two proposition P and Q. Those pairs are (T, T ), (T, F ), (F, T ), and (F, F ). Therefore, the domain of a function contains four points. For each point a function can attain two values either T or F. Hence the total number of all possible binary functions is 2 4 = 16. Here is the table of them: P Q f 1 f 2 f 3 f 4 f 5 f 6 f 7 f 8 T T T T T T T T T T T F T T T T F F F F F T T T F F T T F F F F T F T F T F T F P Q f 9 f 10 f 11 f 12 f 13 f 14 f 15 f 16 T T F F F F F F F F T F T T T T F F F F F T T T F F T T F F F F T F T F T F T F The functions f 9 f 16 are negations of the functions f 1 f 8 and can be removed (f 16 is negation to f 1, f 15 is negation to f 2, and etc.) The function f 1 = T is constant, f 4 = P, f 6 = Q. The only nontrivial functions are f 2, f 3, f 5, f 7, and f 8, and they have special names and notations that have to be remembered: f 8 is called logic AND (conjunction) and denoted by P Q f 2 is called logic OR (disjunction) and denoted by P Q f 5 is called conditional (implication) and denoted by P Q f 7 is called biconditional (double implication) and denoted by P Q We omitted f 3 which is another conditional Q P because it is similar to f 5. Sometimes f 10 is called exclusive OR and denoted by P Q. We are not going to use it here since it is just a negation of f 7. A conditional proposition can be expressed as If P then Q, where P is called a hypothesis and Q is called a conclusion. 3

Ternary It contains three propositions and its domain is made of 2 3 = 8 triplets of truth values of the propositions. The total number of all possible ternary functions is 2 8 = 256. This number is huge and there is no way to list and remember them all. So, this way is not productive. A productive way is to represent a ternary function as a combination of unary and binary functions. The same is true for any function with the number of arguments greater than three. That is why in logic we do not define operations with the number of arguments greater than two. Although functions of three and more arguments are under consideration. Logic operations and their truth tables A table which is similar to the previous tables and representing one logic operation is called a truth table for the logic operation. Below are truth tables for one unary and all four binary logic operations that have to be memorized Truth table for P : P P T F F T Truth table for P Q: P Q P Q T T T T F F F T F F F F Truth table for P Q: P Q P Q T T T T F T F T T F F F 4

Truth table for P Q: P Q P Q T T T T F F F T T F F T Truth table for P Q: P Q P Q T T T T F F F T F F F T Compound propositions Binary logic operations are called connectives. A proposition made of several propositions and containing unary and binary operations is called a compound proposition or a formula. Primitive propositions that do not contain unary or binary operations are called atoms. Order of operations In compound propositions the following order of operations is applied: Negation Logic AND precedes logic OR In other cases use parentheses to specify the order of operations. Example. P Q R is not the same as P (Q R) or (P Q) R. Example. Find the truth table for the compound proposition P Q 5

P Q P P Q T T F T T F F F F T T T F F T T Equivalent propositions Two propositions are equivalent if their truth tables are the same. Example. Show that P Q is equivalent to P Q. The truth table for P Q is P Q P Q T T T T F F F T T F F T which equals to truth table P Q in the previous example. Hence these two propositions are equivalent. Alternative solution: Construct the truth table for the compound proposition ( P Q) (P Q) and show that its last column contains only T values. Example. By constructing truth tables prove De Morgan s Law ( (P Q)) ( P Q), where the sign means equivalence. Truth table: P Q P Q (P Q) P Q P Q T T T F F F F T F T F F T F F T T F T F F F F F T T T T The fourth and seventh columns are equivalent. Hence, De Morgan s Law is true. Alternative solution: Construct the truth table for the compound proposition ( (P Q)) ( P Q) and show that its last column contains only T values. 6

Definition [1] A compound proposition that is true regardless of the truth values of its atoms is called a tautology. Example. By constructing truth table show that the proposition (P Q) P is a tautology. Truth table: P Q P Q (P Q) P T T T T T F F T F T F T F F F T The last column contains true values only. Hence, the proposition (P Q) P is a tautology. Example. Show that the proposition (P Q) (P Q) is a tautology. Truth table: P Q Q P Q P Q (P Q) (P Q) T T F F T T T F T T T T F T F F F T F F T F T T The last column has true values. Hence, the proposition (P Q)) (P Q) is a tautology. Definition [1] A compound proposition that is false regardless of the truth values of its atoms is called a contradiction. Example. Show that the proposition (P Q) ( P ) is a contradiction. Truth table: P Q P Q P (P Q) ( P ) T T T F F T F F F F F T F T F F F F T F 7

The last column contains false values only. contradiction. Hence, the proposition (P Q) ( P ) is a Definition [1] A conditional proposition that is not tautological is called a fallacy. Example. Show that the proposition (P Q) ( P ) is a fallacy. Truth table: P Q Q P Q P (P Q) ( P ) T T F F F T T F T T F F F T F F T T F F T F T T The last column does not contain true values only. Hence, the conditional proposition (P Q) ( P ) is a fallacy. Definition [1] of inference. A conditional or biconditional proposition that is a tautology is called a rule Example. Show that the proposition ((P Q) P ) Q is a rule of inference. The proposition is conditional. We need to show that it is a tautology. Truth table: P Q P Q P (P Q) P ((P Q) P ) Q T T T F F T T F T F F T F T T T T T F F F T F T The last column contains true values only. Hence, the proposition ((P Q) P ) Q is a tautology and it is a rule of inference. 8

Rules of inference Double negation: ( A) A Simplification: A B A Addition: A A B Disjunctive syllogism: ((A B) A) B Reductio ad absurdum: (( A B) ( A B)) A Modus ponens: (A (A B)) B Modus tollens: ( B (A B)) A Contrapositive: (A B) ( B A) Deduction principle: ((A B) C) (A (B C)) Hypothetical syllogism: ((A B) (B C) (A C) Case analysis: ((A B) (A C) (B C)) C Distributivity: (A (B C)) (A B) (A C), (A (B C)) (A B) (A C) DeMorgan s laws: (A B) A B, (A B) A B Some fallacies: (A (A B)) B, (B (A B)) A, ( A (A B)) B Definition [1] A theorem is a proposition of the form If H 1, H 2,..., H n then C where each H i, i = 1, 2,..., n is a proposition called hypothesis and C is a proposition called conclusion. Definition [1] A proof of the theorem If H 1, H 2,..., H n then C is a finite sequence P 1,..., P k of propositions with P k = C, and such that each of P i is either a hypothesis, or the conclusion of the rules of inference which has as hypothesis one or more of the previous propositions. If the theorem If H 1, H 2,..., H n then C is true we write H 1, H 2,..., H n C 9

Definition [1] Types of proofs Let If H 1, H 2,..., H n then C be a theorem. There are several types of proofs Direct proof: H 1, H 2,..., H n C is proved. Proof by contrapositive: Proof by contradiction: C (H 1 H 2 H n ) is proved. H 1, H 2,..., H n, C D is proved, where D is a contradiction. If the hypothesis is of the form (H 1,..., H n ) (K 1,..., K m ) then we also have proof by exhaustion: H 1,..., H n C and K 1,..., K m C are proved. Definition An algebra (or algebraic structure) is a set A of its elements together with their values and a collection of operations on A that operate on values of elements of A. A propositional logic is a simplest possible nontrivial algebra. Its simplicity comes from the fact that each element (proposition) has only two values and there are no n-ary operations for n 3. First-order logic [1] In mathematics we typically encounter more complicated sentences that depend on variables and whose truth value depends on the value of the variables. To handle such statements we need to consider an extension of propositional logic, called first-order logic. Definition A predicate, also called open statement, is a sentence with one or more variables such that when the variable is replaced by a value from a specified domain, also called universe of discourse, the resulting sentence is a statement in propositional logic (i.e. unambiguously true or false). To be able to create statements in propositional logic from predicates we need to expand the lexicon of propositional logic by adding the following quantifiers: for for some, there exists... such that..., for for all. is called the existential quantifier, and is called the universal quantifier. A proposition in first-order logic is made of propositions in propositional logic, predicates, and quantifiers. 10

Negation of propositions There are several simple negations that should be memorized: ( P ) = P (P Q) = P Q (P Q) = P Q (P Q) = P Q ( x P (x)) = x P (x) ( x P (x)) = x P (x) For example the last proposition is read as the negation of for all x P (x) is true is the same as there exists x for which P (x) is false. Example Negate the statement: ε > 0 M N such that n M x n x < ε. ε > 0 such that M N n M x n x > ε. Example. Theorem. There is no rational square root of 2. In the statement of the theorem rational means a rational number of the form m n where m and n are integer numbers with no common factors. To prove the theorem we restate its statement in the form of hypotheses and conclusion. Our first try is Theorem. If r 2 = 2 then r m n Our second try is where m and n are integer numbers with no common factors. Theorem. If r 2 = 2 and m and n are integer numbers with no common factors then r m n. The last form of the theorem has hypotheses and a conclusion. Let s write them down: Hypothesis 1, H 1 : r 2 = 2. Hypothesis 2, H 2 : Conclusion, C: r m n. In terms of logic the theorem is Theorem. H 1 H 2 C. m and n are integer numbers with no common factors. We will prove it by contrapositive: C (H 1 H 2 ) is proved 11

Applying the negation to the right side we obtain C H 1 H 2 In other words, we have to prove the following Theorem. IF r = m n THEN r2 2 OR m and n are integer numbers with common factors. Proof : r = m n r2 = m2 n 2. 1. r 2 2 and the theorem is proven. OR 2. r 2 = 2. We have two cases: In this case we have m2 n 2 = 2 m2 = 2n 2 m is even. Indeed, if m is odd then m 2 also must be odd and cannot be equal 2n 2 which is even. So, m = 2k for some integer number k. Then (2k) 2 = 2n 2, 4k 2 = 2n 2, 2k 2 = n 2 and n must be even, i.e. n = 2l for some integer number l. The last means that m and n have a common factor 2. The theorem is proven. References [1] Bogdan Ion Math 0413 lecture notes. 12