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

Mathematical Induction Part Two

Mathematical Logic Part One

Formal Logic. Critical Thinking

Mathematical Logic Part Two

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

Mathematical Logic Part Three

Announcements. Problem Set 1 out. Checkpoint due Monday, September 30. Remaining problems due Friday, October 4.

Mathematical Logic Part Three

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

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

Deduction by Daniel Bonevac. Chapter 3 Truth Trees

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

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

Definition 2. Conjunction of p and q

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

THE LOGIC OF COMPOUND STATEMENTS

Outline for Today. What is an Implication? Negations and their Applications. Proof by Contrapositive. Proof by Contradiction

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

First Order Logic: Syntax and Semantics

13.3 Truth Tables for the Conditional and the Biconditional

Truth Tables for Arguments

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

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

1.1 Statements and Compound Statements

Propositional Language - Semantics

Truth-Functional Logic

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Topic 1: Propositional logic

CHAPTER 1. MATHEMATICAL LOGIC 1.1 Fundamentals of Mathematical Logic

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

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

CSC Discrete Math I, Spring Propositional Logic

Outline for Today. What is an Implication? Negations and their Applications. Proof by Contrapositive. Proof by Contradiction

A Little Deductive Logic

Logic and Truth Tables

Section 1.1: Logical Form and Logical Equivalence

Functions. Lecture 4: Truth functions, evaluating compound statements. Arithmetic Functions. x y x+y

CSE 240 Logic and Discrete Mathematics

The Inductive Proof Template

Discrete Mathematics and Applications COT3100

INTRODUCTION TO LOGIC. Propositional Logic. Examples of syntactic claims

A Little Deductive Logic

Ella failed to drop the class. Ella dropped the class.

Symbolic Logic 3. For an inference to be deductively valid it is impossible for the conclusion to be false if the premises are true.

AMTH140 Lecture 8. Symbolic Logic

THE LOGIC OF COMPOUND STATEMENTS

Introducing Proof 1. hsn.uk.net. Contents

The statement calculus and logic

Guide to Negating Formulas

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

EECS 1028 M: Discrete Mathematics for Engineers

Discrete Mathematics and Its Applications

PHIL12A Section answers, 16 February 2011

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

Mathematical Logic Part Three

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

PHIL 422 Advanced Logic Inductive Proof

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

Ling 130 Notes: Syntax and Semantics of Propositional Logic

Chapter 4: Classical Propositional Semantics

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

CS103 Handout 09 Fall 2012 October 19, 2012 Problem Set 4

CSE 20. Lecture 4: Introduction to Boolean algebra. CSE 20: Lecture4

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

2 Truth Tables, Equivalences and the Contrapositive

4 Derivations in the Propositional Calculus

CS1800: Hex & Logic. Professor Kevin Gold

Completeness in the Monadic Predicate Calculus. We have a system of eight rules of proof. Let's list them:

Arguments and Proofs. 1. A set of sentences (the premises) 2. A sentence (the conclusion)

Propositional Logic. Propositional Equivalences. Agenda. Yutaka HATA, IEEE Fellow. Ch1.1 Propositional Logic. Ch1.2 Propositional Equivalences

Predicates, Quantifiers and Nested Quantifiers

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

Proof strategies, or, a manual of logical style

Chapter 2: The Logic of Compound Statements

Mathematical Logic Part Three

Mathematical Logic Part Three

Propositional Logic and Semantics

TRUTH TABLES LOGIC (CONTINUED) Philosophical Methods

1 The Foundations. 1.1 Logic. A proposition is a declarative sentence that is either true or false, but not both.

PHI Propositional Logic Lecture 2. Truth Tables

PL: Truth Trees. Handout Truth Trees: The Setup

Propositional logic ( ): Review from Mat 1348

Propositional Logic. Fall () Propositional Logic Fall / 30

Manual of Logical Style (fresh version 2018)

Math.3336: Discrete Mathematics. Applications of Propositional Logic

15414/614 Optional Lecture 1: Propositional Logic

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

MA103 STATEMENTS, PROOF, LOGIC

3 The Semantics of the Propositional Calculus

- 1.2 Implication P. Danziger. Implication

Comp487/587 - Boolean Formulas

Section 3.1 Statements, Negations, and Quantified Statements

Foundation of proofs. Jim Hefferon.

Transcription:

Mathematical Logic Part One

Announcements Problem Set 3 checkpoint due right now. Problem Set 2 due now with a late day. Solutions distributed at end of lecture.

One inal Note on the Pigeonhole Principle

Pigeonholing Injective unctions Consider a function f : A B for finite sets A and B. If A > B, then by the pigeonhole principle some element of B has at least two elements of A that map to it. hus f cannot be injective.

Bitstrings A bitstring is a finite sequence of 0s and 1s. Examples: 11011100 010101010101 0000 ε (the empty string) here are 2 n bitstrings of length n.

Data Compression Inside a computer, all data are represented as sequences of 0s and 1s (bitstrings) o transfer data (across a network, on DVDs, on a flash drive, etc.), it is advantageous to try to reduce the number of 0s and 1s before transferring it. Most real-world data can be compressed by exploiting redundancies. ext repeats common patterns ( the, and, etc.) Bitmap images use similar colors throughout the image. Idea: Replace each bitstring with a shorter bitstring that contains all the original information. his is called lossless data compression.

101010101010101010101010101010 1111010 Compress ransmit 1111010 Decompress 101010101010101010101010101010

Lossless Data Compression In order to losslessly compress data, we need two functions: A compression function C, and A decompression function D. hese functions must be inverses of one another: D(C(x)) = x. Otherwise, we can't uniquely encode or decode some bitstring. herefore, C must be injective. Otherwise, C(x 0 ) = y = C(x 1 ) for some x 0 and x 1, and so we can't tell whether D(y) = x 0 or D(y) = x 1.

A Perfect Compression unction Ideally, the compressed version of a bitstring would always be shorter than the original bitstring. Question: Can we find a lossless compression algorithm that always compresses a string into a shorter string? o handle the issue of the empty string (which can't get any shorter), let's assume we only care about strings of length at least 10.

A Counting Argument Let n be the set of bitstrings of length n, and <n be the set of bitstrings of length less than n. How many bitstrings of length n are there? Answer: 2 n How many bitstrings of length less than n are there? Answer: 2 0 + 2 1 + + 2 n 1 = 2 n 1 Using our earlier result, by the pigeonhole principle, there cannot be an injection from n to <n. Since a perfect compression function would have to be an injection from n to <n, there is no perfect compression function!

Why this Result is Interesting Our result says that no matter how hard we try, it is impossible to compress every string into a shorter string. No matter how clever you are, you cannot write a lossless compression algorithm that always makes strings shorter. In practice, only highly redundant data can be compressed. he fields of information theory and Kolmogorov complexity explore the limits of compression; if you're interested, go explore!

An Important Question How do we formalize the logic we've been using in our proofs?

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

Propositional Logic

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

Some Sample Propositions Puppies are cuter than kittens. Kittens are cuter than puppies. Usain Bolt can outrun everyone in this room. CS103 is useful for cocktail parties. his is the last entry on this list.

More Propositions I'm a single lady. his place about to blow. Party rock is in the house tonight. We can dance if we want to. We can leave your friends behind.

hings hat Aren't Propositions Commands Commands cannot cannot be be true true or or false. false.

hings hat Aren't Propositions Questions Questions cannot cannot be be true true or or false. false.

hings hat Aren't Propositions he he first first half half is is a a valid valid proposition. proposition. I am the walrus, goo goo g'joob Jibberish Jibberish cannot cannot be be true true or or false. false.

Propositional Logic Propositional logic is a mathematical system for reasoning about propositions and how they relate to one another. Propositional logic enables us to ormally encode how the truth of various propositions influences the truth of other propositions. Determine if certain combinations of propositions are always, sometimes, or never true. Determine whether certain combinations of propositions logically entail other combinations.

Variables and Connectives Propositional logic is a formal mathematical system whose syntax is rigidly specified. Every statement in propositional logic consists of propositional variables combined via logical connectives. Each variable represents some proposition, such as You liked it or You should have put a ring on it. Connectives encode how propositions are related, such as If you liked it, you should have put a ring on it.

Propositional Variables Each proposition will be represented by a propositional variable. Propositional variables are usually represented as lower-case letters, such as p, q, r, s, etc. If we need more, we can use subscripts: p 1, p 2, etc. Each variable can take one one of two values: true or false.

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

ruth ables p q p q

ruth ables p q p q

ruth ables p p

Implication An important connective is logical implication: p q. Recall: p q means if p is true, q is true as well. Recall: p q says nothing about what happens if p is false. Recall: p q says nothing about causality; it just says that if p is true, q will be true as well.

Implication, Diagrammatically Any time P is true, Q is true as well. Set of where P is true Set of where Q is true Any time P isn't true, Q may or may not be true.

When p Does Not Imply q p q means if p is true, q is true as well. Recall: he only way for p q to be false is if we know that p is true but q is false. Rationale: If p is false, p q doesn't guarantee anything. It's true, but it's not meaningful. If p is true and q is true, then the statement if p is true, then q is also true is itself true. If p is true and q is false, then the statement if p is true, q is also true is false.

Set of where P is true P Q is false P can be true without Q being true as well Set of where Q is true

ruth able for Implication p q p q p he only way for q to be false is for p to be true and q to be false.

he Biconditional he biconditional connective p q is read p if and only if q. Intuitively, either both p and q are true, or neither of them are. p q p q One interpretation of is to think of it as equality: the two propositions must have equal truth values.

rue and alse here are two more connectives to speak of: 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.)

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.

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

ranslating into Propositional Logic

Some Sample Propositions a: here is a velociraptor outside my apartment. b: Velociraptors can open windows. c: I am in my apartment right now. d: My apartment has windows. e: I am going to be eaten by a velociraptor I won't be eaten by a velociraptor if there isn't a velociraptor outside my apartment. a e

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

Some Sample Propositions a: here is a velociraptor outside my apartment. b: Velociraptors can open windows. c: I am in my apartment right now. d: My apartment has windows. e: I am going to be eaten by a velociraptor If there is a velociraptor outside my apartment, but it can't open windows, I am not going to be eaten by a velociraptor. a b e

p, but q translates to p q

Some Sample Propositions a: here is a velociraptor outside my apartment. b: Velociraptors can open windows. c: I am in my apartment right now. d: My apartment has windows. e: I am going to be eaten by a velociraptor I am only in my apartment when there are no velociraptors outside. c a

p only when q translates to p q

he akeaway Point When translating into or out of propositional logic, be very careful not to get tripped up by nuances of the English language. In fact, this is one of the reasons we have a symbolic notation in the first place! Many prepositions lead to counterintuitive translations; make sure to double-check yourself!

More Elaborate ruth ables his gives the final truth value for the expression. p q p (p q)

Logical Equivalence

Negations p q is false if and only if (p q) is true. Intuitively, this is only possible if either p is false or q is false (or both!) In propositional logic, we can write this as p q. How would we prove that (p q) and p q are equivalent? Idea: Build truth tables for both expressions and confirm that they always agree.

Negating AND p q (p q) p q p q hese two statements are always the same!

Logical Equivalence If two propositional logic statements φ and ψ always have the same truth values as one another, they are called logically equivalent. We denote this by φ ψ. is not a connective. Connectives are a part of logic statements; is something used to describe logic statements. It is part of the metalanguage rather than the language. If φ ψ, we can modify any propositional logic formula containing φ by replacing it with ψ. his is not true when we talk about first-order logic; we'll see why later.

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

More Negations When is p q false? Answer: p must be true and q must be false. In propositional logic: p q Is the following true? (p q) p q

Negating Implications p q (p q) p q p q (p q) p q

An Important Observation We have just proven that (p q) p q If we negate both sides, we get that 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 If p is false, the whole thing is true and we gain no information. If p is true, then q has to be true for the whole expression to be true.

Another Idea We've just shown that (p q) p q. Is it also true that (p q) p q? Let's go check!

(p q) and p q p q (p q) p q p q hese are not the same thing!

o prove that p q is false, do not prove p q. Instead, prove that p q is true.

Next ime irst-order Logic How do we reason about multiple objects and their properties?