43
Introduction to Logic & Set Theory Martin Russell EE1J2 Discrete Mathematics

Introduction to Logic & Set Theory Martin Russell EE1J2 Discrete Mathematics

  • View
    243

  • Download
    2

Embed Size (px)

Citation preview

Introduction to Logic & Set Theory

Martin Russell

EE1J2 Discrete Mathematics

EE1J2 - Slide 2

Outline of lecture 1 Introduction to course Textbooks What is formal logic? Propositional logic Propositions Propositional connectives Formalisation of arguments

EE1J2 - Slide 3

EE1J2 Propositional Logic

Basic ideas: propositions, connectives Formalising statements in ‘natural language’ Formal proofs

Set theory Basic ideas: definitions of sets Relations, functions and equivalence relations Cardinality, finite, countable and uncountable sets

Predicate Logic Logic programming

EE1J2 - Slide 4

Tutorial sheets One tutorial sheet handed out each week To be handed in approx 1 week later Questions and model solutions will appear

on my web pages

EE1J2 - Slide 5

Web Pages http://www.eee.bham.ac.uk/russellm/ee1j2.html All materials used in course will appear on course

web pages Powerpoint slides Homework sheets Homework solutions

Please don’t print the notes – I’ll hand out copies each week

EE1J2 - Slide 6

Class test (week 6) Questions in class test will be selected from

tutorial sheets So, if you do the tutorial sheets you should

do well in the class test!

EE1J2 - Slide 7

Recommended Books

John Truss, “Discrete Mathematics for Computer Scientists”, Addison-Wesley, Second Edition, 1999

 

EE1J2 - Slide 8

Recommended Books (cont.) Nimal Nissanke,

“Introductory Logic and Sets for Computer Scientists”, Addison-Wesley, 1999

EE1J2 - Slide 9

Recommended Books New this year: James A Anderson,

“Discrete Mathematics with Combinatorics (2nd edition)”, Prentice-Hall, 2004

EE1J2 - Slide 10

Recommended books (cont.) Rod Haggarty

“Discrete mathematics for computing”

Addison Wesley

A Chetwynd and P Diggle,

“Discrete Mathematics” Butterworth-Heinemann

EE1J2 - Slide 11

Other books

I have also made use of two other books:  Geoffrey Finch, “How to study

linguistics”, Macmillan, 1998 J N Crossley and others, “What is

mathematical logic?”, Oxford University Press, 1972

EE1J2 - Slide 12

Introduction to logic What is logic? Why is it useful? Types of logic

Propositional logic Predicate logic

EE1J2 - Slide 13

What is logic?

“Logic is the beginning of

wisdom, not the end”

EE1J2 - Slide 14

What is logic? Logic n.1. The branch of philosophy

concerned with analysing the patterns of reasoning by which a conclusion is drawn from a set of premises, without reference to meaning or context

(Collins English Dictionary)

EE1J2 - Slide 15

Why study logic? Logic is concerned with two key skills,

which any computer engineer or scientist should have: Abstraction Formalisation

EE1J2 - Slide 16

Why is logic important? Logic is a formalisation of reasoning. Logic is a formal language for deducing

knowledge from a small number of explicitly stated premises (or hypotheses, axioms, facts)

Logic provides a formal framework for representing knowledge

Logic differentiates between the structure and content of an argument

EE1J2 - Slide 17

Logic as formal language In this course, logic will be presented as a

formal language Within that formal language:

Knowledge can be stated concisely and precisely

The process of reasoning from that knowledge can be made rigorous

EE1J2 - Slide 18

What is an argument?

An argument is just a sequence of statements.

Some of these statements, the premises, are assumed to be true and serve as a basis for accepting another statement of the argument, called the conclusion

EE1J2 - Slide 19

Deduction and inference If the conclusion is justified, based solely on the

premises, the process of reasoning is called deduction

If the validity of the conclusion is based on generalisation from the premises, based on strong but inconclusive evidence, the process is called inference (sometimes called induction)

This course is concerned only with deduction

EE1J2 - Slide 20

Two examples Deductive argument:

“Alexandria is a port or a holiday resort. Alexandria is not a port. Therefore, Alexandria is a holiday resort”

Inductive argument“Most students who did not do the tutorial

questions will fail the exam. John did not do the tutorial questions. Therefore John will fail the exam”

EE1J2 - Slide 21

Some different types of logic

Historically, a number of types of logic have been proposed.

In this course we will studyPropositional logic (Boole, 1815-1864)

Predicate logic (Frege 1848-1925)

EE1J2 - Slide 22

Propositional logic

Simple types of statements, called propositions, are treated as atomic building blocks for more complex statements

Alexandria is a port or a holiday resort.

Alexandria is not a port.

Therefore, Alexandria is a holiday resort

EE1J2 - Slide 23

Propositional logic

Basic propositions in the argument are

p – Alexandria is a port

q – Alexandria is a holiday resort. In abstract form, the argument becomes

p or q

Not q

Therefore q

EE1J2 - Slide 24

Predicate logic Extension of propositional logic A ‘predicate’ is just a property Predicates define relationships between

any number of entities using qualifiers: “for all”, “for every” “there exists”

EE1J2 - Slide 25

Example Let P(x) be the property

‘if x is a triangle then the sum of its internal angles is 180o”

In predicate logic:

x P(x) “For every x such that x is a triangle, the

sum of the internal angles of x is 180o”

EE1J2 - Slide 26

Another example Let P(x) be the property

‘x is an integer and x2 = 4’ Then

x P(x) “There exists x such that x is an integer and

x2 = 4”

EE1J2 - Slide 27

Newton’s second law of motion

x: Object stationary(x) in-uniform-motion (x) f : Force x is-acted-upon-by f

In English: “for every x of a certain type referred to as an Object, x is stationary, x is in uniform motion, or there is an f of type Force such that x is acted upon by f”

“for every x” “of type called object” “or”

“there exists an f”

EE1J2 - Slide 28

and Remember:

x ‘for every x’, or ‘for All x’

x ‘there is an x’ or ‘there Exists an x’

Tip:

Think of as an upside down ‘A’ (‘for All’)

Think of as a backwards ‘E’ (‘there Exists’)

EE1J2 - Slide 29

Propositions A (atomic, elementary) proposition is the

underlying meaning of a simple declarative sentence, which is either true or false

The truth or falsehood of a proposition is indicated by assigning it one of the truth values T (for true) or F (for false)

EE1J2 - Slide 30

Example propositions

Mammals are warm blooded

The sun orbits the earth

The evergreen forests of Canada consist of spruce, pine and fir trees

John is taller than Joan

Joan is shorter than John

John is not shorter than Joan

EE1J2 - Slide 31

Sentences which are not propositions

Over millions of years they build up on top of one another to form a reef

Can the arctic hare change the colour of its coat to match its surroundings?

Put down that book!

EE1J2 - Slide 32

Which are propositions?

Can pigs fly?

Pigs can fly

Sparrows can fly

Joe runs faster than Patrick

Patrick runs slower than Joe

Pay your bills on time

The circumference of a circle is equal to four times its diameter

EE1J2 - Slide 33

Propositional connectives These are the words that we use to join

atomic propositions together to form compound propositions. E.G:

In 1938 Hitler seized Austria, (and) in 1939 he seized former Czechoslovakia and in 1941 he attacked the former USSR while still having a non-aggression pact with it

EE1J2 - Slide 34

Propositional connectives Propositional logic has four connectives

Name Read as Symbol

negation ‘not’

conjunction ‘and’

disjunction ‘or’

implication ‘if…then…’

EE1J2 - Slide 35

Connective Interpretation

negation p is true if and only if p is false

A conjunction pq is true if and only if both p and q are true

A disjunction pq is true if and only if p is true or q is true.

An implication p q is false if and only if p is true and q is false

Interpretation of connectives

EE1J2 - Slide 36

Some more terminology… Expressions either side of a conjunction are

called conjuncts (pq) Expressions either side of a disjunction are

called disjuncts (pq) In the implication p q, p is called the

antecedent and q is the consequence

EE1J2 - Slide 37

Precedence of connectives In complex propositions, brackets may be

used to remove ambiguity.

(p q) r versus p (q r) By convention, the order of precedence

Brackets, Negation, Conjunction, Disjunction, Implication

EE1J2 - Slide 38

Formalisation

StatementIn 1938 Hitler seized Austria, (and) in 1939 he seized former Czechoslovakia and in 1941 he attacked the former USSR while still having a non-aggression pact with it

EE1J2 - Slide 39

Formalisation (continued)

Atomic propositions:p – In 1938 Hitler seized Austriaq – In 1939 Hitler seized former Czechoslovakiar – In 1941 Hitler attacked the former USSRs – In 1941 Hitler had a non-aggression pact with the former USSR

Formalisation in Propositional Logic:p q r s

EE1J2 - Slide 40

Although both Stanley and Gordon are not young, Stanley has a better chance of winning the next bowling tournament, despite Gordon’s considerable experience

Formalisation

EE1J2 - Slide 41

Formalisation (continued)

Atomic propositions:p – Stanley is young

q – Gordon is young

r – Stanley has a better chance of winning the next bowling tournament

s – Gordon has considerable experience in bowling

Formalisation in Propositional Logic:(p) (q) r s

EE1J2 - Slide 42

Negation and atomic propositions

Note that for first atomic proposition I chose:

Stanley is young

and not

Stanley is not young

EE1J2 - Slide 43

Summary of Lecture 1 Introduction to course Textbooks What is formal logic? Propositional logic Propositions Propositional connectives Formalisation of arguments