Mathematical Logic Part One

Similar documents
Mathematical Logic Part One

Mathematical Logic Part One

Mathematical Logic Part One

Mathematical Logic Part One

Mathematical Logic Part One

Mathematical Logic Part One

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

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

Mathematical Logic Part One

CSC Discrete Math I, Spring Propositional Logic

Discrete Mathematics and Its Applications

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

Compound Propositions

Definition 2. Conjunction of p and q

Mathematical Logic Part Two

Boolean Logic. CS 231 Dianna Xu

Propositional Logic. Fall () Propositional Logic Fall / 30

Logic. Propositional Logic: Syntax

Section 1.1: Logical Form and Logical Equivalence

Discrete Mathematics and Applications COT3100

13.3 Truth Tables for the Conditional and the Biconditional

PHIL12A Section answers, 16 February 2011

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

Guide to Negating Formulas

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

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

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

Propositional logic ( ): Review from Mat 1348

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

An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04

AMTH140 Lecture 8. Symbolic Logic

3 The Semantics of the Propositional Calculus

CS1800: Hex & Logic. Professor Kevin Gold

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

First Order Logic: Syntax and Semantics

Lecture 02: Propositional Logic

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

EECS 1028 M: Discrete Mathematics for Engineers

Propositional Logic: Syntax

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Introducing Proof 1. hsn.uk.net. Contents

Deduction by Daniel Bonevac. Chapter 3 Truth Trees

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Sec$on Summary. Propositions Connectives. Truth Tables. Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional

MA103 STATEMENTS, PROOF, LOGIC

15414/614 Optional Lecture 1: Propositional Logic

Topic 1: Propositional logic

Manual of Logical Style (fresh version 2018)

Mathematical Logic Part Three

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

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

1.1 Statements and Compound Statements

Formal Logic. Critical Thinking

Supplementary Logic Notes CSE 321 Winter 2009

PROBLEM SET 3: PROOF TECHNIQUES

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

Logic. Propositional Logic: Syntax. Wffs

Math 300 Introduction to Mathematical Reasoning Autumn 2017 Proof Templates 1

Axiomatic systems. Revisiting the rules of inference. Example: A theorem and its proof in an abstract axiomatic system:

Logic As Algebra COMP1600 / COMP6260. Dirk Pattinson Australian National University. Semester 2, 2017

Truth-Functional Logic

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

The statement calculus and logic

Mathematical Logic Part Three

Manual of Logical Style

DISCRETE STRUCTURES WEEK5 LECTURE1

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

Propositional Logic and Semantics

Equivalence and Implication

Predicates, Quantifiers and Nested Quantifiers

Propositional Logic. Spring Propositional Logic Spring / 32

TRUTH TABLES LOGIC (CONTINUED) Philosophical Methods

Stanford University CS103: Math for Computer Science Handout LN9 Luca Trevisan April 25, 2014

Mathematics for Computer Science Exercises from Chapter 3

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

Introduction to Decision Sciences Lecture 2

LING 106. Knowledge of Meaning Lecture 3-1 Yimei Xiang Feb 6, Propositional logic

Mathematical Logic Part Three

7 LOGICAL AGENTS. OHJ-2556 Artificial Intelligence, Spring OHJ-2556 Artificial Intelligence, Spring

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.

2.2: Logical Equivalence: The Laws of Logic

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Packet #1: Logic & Proofs. Applied Discrete Mathematics

CSE 20 DISCRETE MATH. Fall

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1

Today s Topic: Propositional Logic

2 Truth Tables, Equivalences and the Contrapositive

DeMorgan s Laws and the Biconditional. Philosophy and Logic Sections 2.3, 2.4 ( Some difficult combinations )

MITOCW watch?v=ko0vmalkgj8

MITOCW MIT18_01SCF10Rec_24_300k

Part I: Propositional Calculus

Section 1.2: Propositional Logic

Propositional Logic: Semantics

Chapter 3: Logic. Diana Pell. A statement is a declarative sentence that is either true or false, but not both.

PROPOSITIONAL CALCULUS

A Little Deductive Logic

Symbolic Logic Outline

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.

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

~ p is always false. Based on the basic truth table for disjunction, if q is true then p ~

Transcription:

Mathematical Logic Part One

Question: How do we formalize the definitions and reasoning we use in our proofs?

Where We're Going Propositional Logic (oday) Basic logical connectives. ruth tables. Logical equivalences. First-Order Logic (Wednesday/Friday) Reasoning about properties of multiple objects.

Propositional Logic

A proposition is a statement that is, by itself, either true or false.

Propositional Logic Propositional logic is a mathematical system for reasoning about propositions and how they relate to one another. Every statement in propositional logic consists of propositional variables combined via propositional connectives. Each variable represents some proposition, so each variable has value true or false. Connectives encode how propositions are related.

Propositional Connectives Logical NO: p p is true if and only if p is false. Also called logical negation. Logical AND: p q p q is true if and only if both p and q are true. Also called logical conjunction. Logical OR: p q p q is true if and only if at least one of p or q are true (inclusive OR) Also called logical disjunction.

ruth ables A truth table is a table showing the truth value of a propositional logic formula as a function of its inputs. Useful for several reasons: hey give a formal definition of what a connective means. hey give us a mechanical way to evaluate a complex propositional formula.

ruth able for XOR Recall that our OR connective is inclusive. he truth table at right defines an exclusive or called XOR. We also could have expressed XOR using just the connectives we already had. p q p XOR q F F F F F F Which expresses XOR? XOR? (A) (A) (p (p q) q) (p (p q) q) (B) (B) (p (p q) q) (p (p q) q) (C) (C) (p (p q) q) (p (p q) q) (D) (D) (p (p q) q) (p (p q) q) Answer Answer at at PollEv.com/cs103 PollEv.com/cs103 or or text text CS103 CS103 to to 22333 22333 once once to to join, join, then then A, A, B, B, or or C. C.

Mathematical Implication

ruth able for p q (implies) What What is is the the correct truth truth table table for for implication? Enter Enter your your guess guess as as a list list of of four four values to to fill fill in in the the rightmost column of of the the table. table. (ex: (ex: F, F,,,?,?, F) F) p q p q F F F F Answer Answer at at PollEv.com/cs103 PollEv.com/cs103 or or text text CS103 CS103 to to 22333 22333 once once to to join, join, then then your your response. response.

ruth able for Implication p q p q F F F F F

ruth able for Implication p q p q F F Bad bracket, didn t get A F Bad bracket, got A F F Perfect bracket, didn t get A Perfect bracket, got A

ruth able for Implication p q p q F F F he he implication implication is is only only false false if if p p is is true true and and q q isn t. isn t. It s It s true true otherwise. otherwise. F F

ruth able for Implication p q p q F F F he he implication implication is is only only false false if if p p is is true true and and q q isn t. isn t. It s It s true true otherwise. otherwise. F F You You will will need need to to commit commit this this table table to to memory. memory. (Consider (Consider a a tattoo tattoo on on your your forearm.) forearm.) We re We re going going to to be be using using it it a a lot lot over over the the rest rest of of the the week. week.

Why his ruth able? he truth values of the are the way they are because they're defined that way. Are there other ways we could write a proposition that has the same truth table as, using the other connectives? (like what we did for XOR) Yep! ry to think of some What's the truth table for (p q)?

he Biconditional Connective

he Biconditional Connective he biconditional connective is used to represent a two-directional implication. Specifically, p q means both that p q and that q p. Based on that, what should its truth table look like? ake a guess, and talk it over with your neighbor!

Biconditionals he biconditional connective p q is read p if and only if q. Here's its truth table: p q p q F F F F F F

Biconditionals he biconditional connective p q is read p if and only if q. Here's its truth table: p q F F F p q F One One interpretation interpretation of of is is to to think think of of it it as as equality: equality: the the two two propositions propositions must must have have equal equal truth truth values. values. F F

rue and False In addition to variables and connectives, we have constants: true and false. he symbol is a value that is always true. he symbol is value that is always false. hese are often called connectives, though they don't connect anything. (Or rather, they connect zero things.)

Proof by Contradiction Suppose you want to prove p is true using a proof by contradiction. he setup looks like this: Assume p is false. Derive something that we know is false. Conclude that p is true. In propositional logic: ( p ) p

Operator Precedence How do we parse this statement? x y z x y z Operator precedence for propositional logic: All operators are right-associative. We can use parentheses to disambiguate.

Operator Precedence How do we parse this statement? x y z x y z Operator precedence for propositional logic: All operators are right-associative. We can use parentheses to disambiguate.

Operator Precedence How do we parse this statement? ( x) y z x y z Operator precedence for propositional logic: All operators are right-associative. We can use parentheses to disambiguate.

Operator Precedence How do we parse this statement? ( x) y z x y z Operator precedence for propositional logic: All operators are right-associative. We can use parentheses to disambiguate.

Operator Precedence How do we parse this statement? ( x) y z x (y z) Operator precedence for propositional logic: All operators are right-associative. We can use parentheses to disambiguate.

Operator Precedence How do we parse this statement? ( x) y z x (y z) Operator precedence for propositional logic: All operators are right-associative. We can use parentheses to disambiguate.

Operator Precedence How do we parse this statement? ( x) (y z) (x (y z)) Operator precedence for propositional logic: All operators are right-associative. We can use parentheses to disambiguate.

Operator Precedence How do we parse this statement? ( x) (y z) (x (y z)) Operator precedence for propositional logic: All operators are right-associative. We can use parentheses to disambiguate.

Operator Precedence How do we parse this statement? ( x) ((y z) (x (y z))) Operator precedence for propositional logic: All operators are right-associative. We can use parentheses to disambiguate.

Operator Precedence How do we parse this statement? ( x) ((y z) (x (y z))) Operator precedence for propositional logic: All operators are right-associative. We can use parentheses to disambiguate.

Operator Precedence he main points to remember: binds to whatever immediately follows it. and bind more tightly than. We will commonly write expressions like p q r without adding parentheses. For more complex expressions, you should add parens (the As thank you!) we'll try to add parentheses (if I ever don t and you re confused, ok to ask!)

he Big able Connective Read As C++ Version Fancy Name not! Negation and && Conjunction or Disjunction implies see PS2! Implication if and only if see PS2! Biconditional true true ruth false false Falsity

Recap So Far A propositional variable is a variable that is either true or false. he propositional connectives are Negation: p Conjunction: p q Disjunction: p q Implication: p q Biconditional: p q rue: False:

ranslating into Propositional Logic

Some Sample Propositions a: I will be in the path of totality. b: I will see a total solar eclipse.

Some Sample Propositions a: I will be in the path of totality. b: I will see a total solar eclipse. I I won't won't see see a total total solar solar eclipse eclipse if if I'm I'm not not in in the the path path of of totality. totality.

Some Sample Propositions a: I will be in the path of totality. b: I will see a total solar eclipse. I I won't won't see see a total total solar solar eclipse eclipse if if I'm I'm not not in in the the path path of of totality. totality. a b

p if q translates to q p It does not translate to p q

p, but q translates to p q

Some Sample Propositions a: I will be in the path of totality. b: I will see a total solar eclipse. c: here is a total solar eclipse today.

Some Sample Propositions a: I will be in the path of totality. b: I will see a total solar eclipse. c: here is a total solar eclipse today. If If I I will will be be in in the the path path of of totality, totality, but but there's there's no no solar solar eclipse eclipse today, today, I I won't won't see see a total total solar solar eclipse. eclipse. Which is is equivalent to to the the sentence at at left? left? (A) (A) a c c b b (B) (B) (a (a c) c) b b (C) (C) a ( c ( c b) b) (D) (D) ( a ( a c) c) b b Answer Answer at at PollEv.com/cs103 PollEv.com/cs103 or or text text CS103 CS103 to to 22333 22333 once once to to join, join, then then your your response. response.

Some Sample Propositions a: I will be in the path of totality. b: I will see a total solar eclipse. c: here is a total solar eclipse today. If If I I will will be be in in the the path path of of totality, totality, but but there's there's no no solar solar eclipse eclipse today, today, I I won't won't see see a total total solar solar eclipse. eclipse. a c b

Propositional Equivalences

Quick Question: What would I have to show you to convince you that the statement p q is false?

Quick Question: What would I have to show you to convince you that the statement p q is false?

De Morgan's Laws Using truth tables, we concluded that is equivalent to (p q) p q We also saw that (p q) is equivalent to p q hese two equivalences are called De Morgan's Laws.

De Morgan's Laws in Code Pro tip: Don't write this: if (!(p() && q()) { /* */ } Write this instead: if (!p()!q()) { /* */ } (his even short-circuits correctly!)

Logical Equivalence Because (p q) and p q have the same truth tables, we say that they're equivalent to one another. We denote this by writing (p q) p q he symbol is not a connective. he statement (p q) ( p q) is a propositional formula. If you plug in different values of p and q, it will evaluate to a truth value. It just happens to evaluate to true every time. he statement (p q) p q means these two formulas have exactly the same truth table. In other words, the notation φ ψ means φ and ψ always have the same truth values, regardless of how the variables are assigned.

An Important Equivalence Earlier, we talked about the truth table for p q. We chose it so that p q (p q) Later on, this equivalence will be incredibly useful: (p q) p q

Another Important Equivalence Here's a useful equivalence. Start with p q (p q) By De Morgan's laws: p q (p q) p q p q p q p q hus p q p q

Another Important Equivalence Here's a useful equivalence. Start with p q (p q) By De Morgan's laws: p q (p q) p q p q If p is false, then p q is is true. true. If If p p is is true, true, then then q q has has to to be be true true for for the the whole whole expression expression to to be be true. true. If p is false, then p q p q p q hus p q p q

One Last Equivalence

he Contrapositive he contrapositive of the statement is the statement p q q p hese are logically equivalent, which is why proof by contrapositive works: p q q p

Why All his Matters

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 x + y = 16 x 8 y 8

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 x + y = 16 x 8 y 8

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 (x 8 y 8) (x + y = 16)

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 (x 8 y 8) (x + y = 16)

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 (x 8 y 8) (x + y = 16)

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 (x 8 y 8) x + y 16

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 (x 8 y 8) x + y 16

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 (x 8 y 8) x + y 16

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 (x 8) (y 8) x + y 16

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 (x 8) (y 8) x + y 16

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 (x 8) (y 8) x + y 16

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 x < 8 (y 8) x + y 16

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 x < 8 (y 8) x + y 16

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 x < 8 (y 8) x + y 16

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 x < 8 y < 8 x + y 16

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 x < 8 y < 8 x + y 16

Why All his Matters Suppose we want to prove the following statement: If x + y = 16, then x 8 or y 8 x < 8 y < 8 x + y 16 If x < 8 and y < 8, then x + y 16

heorem: If x + y = 16, then x 8 or y 8. Proof: By contrapositive. We will prove that if x < 8 and y < 8, then x + y 16. Let x and y be arbitrary numbers such that x < 8 and y < 8. Note that x + y < 8 + y < 8 + 8 = 16. his means that x + y < 16, so x + y 16, which is what we needed to show.

Why his Matters Propositional logic is a tool for reasoning about how various statements affect one another. o better understand how to prove a result, it often helps to translate what you're trying to prove into propositional logic first. hat said, propositional logic isn't expressive enough to capture all statements. For that, we need something more powerful.

Next ime First-Order Logic Reasoning about groups of objects. First-Order ranslations Expressing yourself in symbolic math!