logic and proof - maths.fyimaths.fyi/logic/logic.pdf · actually are (except for their truth value)...

27
Logic and Proof Version 2.0 How mathematics is done What is the fundamental process by which we do mathematics? Well in mathematics we do several types of processes, and so use diferent methods. For example we might do calculations, on paper or on a computer, using standard methods. But sometimes we might want to discover new things. Leaving to one side the question of what exactly that means - how is that done? In the sciences, we do it by experiment. For example, we might ask whether heavy things fall faster than light things, or whether they all fall at the same rate. So we do an experiment, dropping heavy and light things and timing their fall. We repeat the experiment, and we get other people to also do the experiment. Everyone fnds everything falls at the same rate (so long as air resistance is negligible). So we think this is true. But we cannot be sure. Maybe next year things might be diferent. Maybe its diferent on Mars or in space. But we are confdent that on Earth, now, it is is true. We can do experiments in mathematics. For example, to fnd the area of triangles, we can draw lots of them, divide them into unit squares and count the area. We will fnd an answer consistent with half base X height. But we cannot be sure. Instead of experiment, we can use the ideas of logic and proof Types of logic The word is used with diferent meanings: Inductive logic For example: Every previous morning, the Sun has risen Therefore, tomorrow morning the Sun will rise. This is based on a lot of previous experience, looking for a consistent pattern, and using that pattern to predict what will happen in the future. Inductive logic, also called inductive reasoning, is widely used in science. The previous experiences are the results of experiments, and these are used to identify 'laws'. As an example, an electric current fowing through a wire afects a nearby compass. We therefore adopt the 'law' that an electric current will produce a magnetic feld. Deductive logic This is about truth, arguments and validity. Deductive logic looks for conclusions which we can be 'sure' are true, in some sense. These notes are about deductive logic. Other logics These include abductive logic and fuzzy logic. The study of logic has been going on from at least the time of the ancient Greeks, and is seen as the Logic Page 1 of 27 Version 13/8/18

Upload: trinhnhan

Post on 23-Aug-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

Logic and ProofVersion 2.0

How mathematics is doneWhat is the fundamental process by which we do mathematics? Well in mathematics we do several types of processes, and so use diferent methods. For example we might do calculations, on paper or on a computer, using standard methods. But sometimes we might want to discover new things. Leaving to one side the question of what exactly that means - how is that done?

In the sciences, we do it by experiment. For example, we might ask whether heavy things fall faster than light things, or whether they all fall atthe same rate. So we do an experiment, dropping heavy and light things and timing their fall. We repeat the experiment, and we get other people to also do the experiment. Everyone fnds everything falls at the same rate(so long as air resistance is negligible). So we think this is true. But we cannot be sure. Maybe next year things might be diferent. Maybe its diferent on Mars or in space. But we are confdent that on Earth, now, it is is true.

We can do experiments in mathematics. For example, to fnd the area of triangles, we can draw lots of them, divide them into unit squares and count the area. We will fnd an answer consistent with half base X height. But we cannot be sure.

Instead of experiment, we can use the ideas of logic and proof

Types of logicThe word is used with diferent meanings:

Inductive logic

For example:

Every previous morning, the Sun has risen

Therefore, tomorrow morning the Sun will rise.

This is based on a lot of previous experience, looking for a consistent pattern, and using that pattern to predict what will happen in the future.

Inductive logic, also called inductive reasoning, is widely used in science. The previous experiences are the results of experiments, and these are used to identify 'laws'.

As an example, an electric current fowing through a wire afects a nearby compass. We therefore adopt the 'law' that an electric current will produce a magnetic feld.

Deductive logic

This is about truth, arguments and validity. Deductive logic looks for conclusions which we can be 'sure' are true, in some sense. These notes are about deductive logic.

Other logics

These include abductive logic and fuzzy logic. The study of logic has been going on from at least the time of the ancient Greeks, and is seen as the

Logic Page 1 of 27 Version 13/8/18

Page 2: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

basis of philosophy and mathematics. Yet paradoxically there is no universal defnition of what logic is.

These notes are about statements which are true or false. But some logics are about statements which could be true, and those which must be true. Temporal logic is about statements which are always true, and those whichare eventually true.

Logic is connected to 'arguments' in the sense of people claiming to explain what has happened, what will happen and what is the best action to take. Politicians often claim to ofer logical arguments - but usually these are invalid or badly stated.

Propositional logic

Natural and formal languages

English, French, German and Hindi are natural languages. These are languages which people speak and write. They have very large vocabularies (sets of words, one hundred thousand or more), subtle semantics (meaning) and very complex grammar (syntax, rules about sentence structure). If someone makes a grammatical error, they are oftenstill understood.

For example

Jack and Jill likes to play chess

is an error, since Jack and Jill are plural, so it should have been 'like to play chess'. But we would guess what is trying to be said.

Formal languages include programming languages and mathematics. Theyusually have small vocabularies ( ffty words or less) and simple but strict grammars. A statement in a formal language with a syntax error is meaningless. For example

x = 4

means that x is 4, but

x 4 =

is syntactically incorrect, and does not mean anything.

What is a proposition?

In logic, a proposition is a statement which is true or false. Examples of propositions are

Paris is the capital of France (true)

2+2=4 (true)

Rome is the capital of Austria (false)

3+1=5 (false)

Many statements in natural languages are not propositions. For example:

Is it raining? (a question, an interrogative)

Stand up! (an instruction, an imperative)

My goodness! (an exclamation)

This chapter starts with the logic of propositions.

Logic Page 2 of 27 Version 13/8/18

Page 3: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

Telling the truth

In natural languages, we normally tell the truth. For example if someone says

'Oslo is the capital of Norway'

people assume they mean

'It is true that Oslo is the capital of Norway'

It would be really inefcient to have to say

'It is true that .. X'

every time, so we just say X.

This is not the case for propositions. They may be true or false. Just because we say them does not mean we think they are true.

More on this when we discuss H P Grice.

Object languages and meta-languages

Suppose someone said:

“In French, you say 'Hello' by saying 'Bonjour'”

This is a sentence in English, about another language, French. All languagetextbooks are like this - they are written in one language, about another language.

We call French the object language - the language we are talking about. The language that we discuss it in, English here, is the meta-language : language about language.

In our case we want to talk about a formal language which is good for logic. Natural languages are not suitable - not least because words have shades of meaning and are often ambiguous, but in logic we want clear defnite meanings. So we invent an object language good for making logical statements - we describe it in the following sections. We talk about it (like here) in English - so English is our meta-language.

Raymond Smullyan gave this example

Some cars rattle

My car is some car!

Therefore my car rattles.

This goes wrong, because 'some cars' has more than one meaning. It can mean 'at least one car', in the frst proposition, and 'an especially good car' in the second proposition. The conclusion is invalid, because it treated 'some car' as meaning the same thing in both propositions.

In our formal language of logic we want to avoid multiple meanings.

We also need to be careful, because there are some words in the object language of logic (and, or, not, if) which are also in English. However their meanings are diferent in logic and in English.

Propositional Connectives

These are used to make new sentences (in the object language) from other sentences:

Logic Page 3 of 27 Version 13/8/18

Page 4: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

Name Symbol Idea

Equivalence ~ is equivalent to

Implication ⊃ implies, if..then

Conjunction ∧ and

Disjunction ∨ or (including both)

Negation ¬ notThere will be more explanation of these shortly.

Sentences, atoms and composite formulas

The object language (the logic bit) might be the standard mathematical language, or a programming language, or something else. We do not specify what the object language is - so we are covering any formal language.

Whatever, it will be possible to write propositions in it ( like 5>3, or 3+2=6(which is false) ).

Such propositions are called atoms - propositions which cannot be split into parts which are themselves propositions.

We can use the connectives to make new propositions from atoms. These are called composite formulas. For example

x > y ∨ y = 4

makes a new sentence by joining the atoms x>y and y=4 with the connective ∨. This new proposition says that either x is greater than y, or yis 4 (or both)

We use capital Roman letters to stand for these atoms and composites - soA, B, C.. P, Q, R.. This is because we do not care what the propositions actually are (except for their truth value) and we do not want to restrict to a single object language.

P Q R are used for atoms, or P1 P2 P3.. if they are in sets.

We use A, B C for formulas - composite or simple atoms. These are also called sentences (so this topic is sometimes called sentential logic) . So A ∧ B, for example, is a formula or sentence.

Predicates

The ancient Greek philosophers studied logic in the form of syllogisms, like

Socrates is a man

All men are mortal

So Socrates is mortal

These work because of two things

1. Some parts of the propositions connect. They are about men or a man

2. They use all. This is a quantifer. Alternative qualifer would be none or no or some.

In 'x .. is a man'

'..is a man' is a predicate, which claims some property of something. More predicates:

... is an even number (we might call this evenp )

Logic Page 4 of 27 Version 13/8/18

Page 5: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

… is a square number (squarep )

... is a type of ellipse (ellipsep )

A predicate takes a 'variable', and is true or false, depending on the variable. For exampleevenp(6) is true

squarep(9) is true

squarep(10) is false

ellipsep(triangle) is false

We can get a more detailed type of logic by including parts of propositions,as predicates, and using quantifers. This is called predicate calculus.

But frst we study propositional calculus, where we just look at atomic propositions and compound formulas - we do not look 'inside' the propositions.

Truth tables

Suppose we have a proposition P. It could be true or false. The negation connective works like this:

P ¬P

F T This row means if P is false, ¬P is true

T F If P is true, ¬P is false

So if P is true, ¬P is false. And if P is false, ¬P is true.

Negation is just 'not'

This is what negation means. The table is an example of a truth table.

Conjunction

Here we have 2 atoms, P and Q:

P Q P ∧ Q

F F F

F T F

T F F

T T T

With two propositions, we have four possible sets of truth values, as shown. P ∧ Q is false for all of them, except when P and Q are both true. So conjunction means the same as 'both'.

Conjunction is sometimes thought of as 'and'. But 'and' is also a word in the meta-language (English), where it can be used in several ways. We canuse it to talk jointly about two things ('I like apples and oranges') or to join two clauses ('He stood up and walked out') and in other senses. The logicalconnective ∧ is much more restricted - it makes a new formula from two others, and the truth value of the new formula depends on the truth valuesof the constituent ones as defned in the truth table.

Disjunction

Again 2 atoms, P and Q:

Logic Page 5 of 27 Version 13/8/18

Page 6: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

P Q P ∨ Q

F F F

F T T

T F T

T T T

So P ∨ Q is true if either one, or both, are true. The standard symbol v comes from the Latin vel. Disjunction is a bit like the English 'or', but English 'or' often implies 'but not both'. So for example:

'Do you want milk or lemon in your tea?'

means you can have milk, or lemon, but not both.

The 'not both' connective in logic is often called 'exclusive-or'

Equivalence

P Q P ~ Q

F F T

F T F

T F F

T T T

S0 P ~ Q is true if P and Q are both true, or both false.

P ~ Q is false if P and Q have diferent truth values.

The connectives and standard English

The connectives are not the same as standard English meanings. Some are close, others are quite confusing.

The closest is negation and not:

I am going to France

I am not going to France

This is having proposition P being 'I am going to France'. If P is true, then ¬P is the proposition 'I am not going to France' being true.

Disjunction has the problem that 'or' usually means one but not both. For example

'Do you want sugar in your tea? Sugar or no sugar?'

You cannot answer this with a yes, even though if it is true that you want sugar, 'I want sugar' v 'I do not want sugar' is true. The Latin vel means one or both, which is why it is used.

For conjunction, 'and' for ∧ is not too bad. However, implication is a problem.

Logic Page 6 of 27 Version 13/8/18

Page 7: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

Implication

P Q P ⊃ Q

F F T

F T T

T F F

T T T

The idea is to be able to express the following:

'x = 3 implies 2x+1 = 7 '

Or 'if x = 3

then 2x+1 = 7 '

Here P is 'x=3' and Q is '2x+1=7'

Suppose we take Q to be '2x+1=9'. Then

'x=3' implies '2x+1=9' is clearly false - this is the T F F row in the truth table.

But the rows where P is false are a problem. For example

'the Moon is made of cheese' implies '2+2=4' is true (this is the F T T row).

Or even worse

'the Moon is made of cheese' implies '2+2=5' is true (the F F T row).

In logical implication, a false proposition implies anything. In other words, F ⊃ X is true, no matter what X is.

Suppose we have a proposition P ⊃ Q, and we want to decide whether it istrue or not. Work it out like this:

Is P false? If so, P ⊃ Q is true

Is P true? Then if Q is also true, P ⊃ Q is true - and otherwise it is false.

The idea is used in a rule of reasoning called modus ponens:

P ⊃ Q is true

P is true

so Q is true

For example

if 24 is even (P) this implies 25 is odd (Q)

24 is even (P is true)

so 25 is odd (Q is true)

The reverse is modus tollens

P ⊃ Q is true

Q is false

so P must be false

For example

31 is even implies 32 is odd

32 is odd is false

so '31 is even' is false

Logic Page 7 of 27 Version 13/8/18

Page 8: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

To work it out quickly, P ⊃ Q is always true except if P is true and Q false

Brackets

Suppose we have the compound formula

P ∧ Q ∨ R

Does this mean the conjunction of P and Q, then the disjunction with R?

Or Q ∨ R frst, the the conjunction with P?

This is like in arithmetic

1+2 X 3

Do we multiply frst, or add frst? In other words, what are the precedence rules?

We fx this simply by using brackets:P ∧ (Q ∨ R) means we do disjunction frst

(P ∧ Q) ∨ R means we do conjunction frst.

Truth tables and compound formulas

We have truth tables for the connectives. But we can use a connective to make a new formula, then use it with another combination - for example (P∧ Q) ∨ R

1P

2Q

3R

4P ∧ Q

5(P ∧ Q) ∨R

F F F F F

F F T F T

F T F F F

F T T F T

T F F F F

T F T F T

T T F T T

T T T T TWe explain this table:

There are 3 atomic propositions, P Q and R in this - these are the 3 'inputs'.In columns 1 2 and 3 we have all the possible combinations of truth values- 8 rows for 3 propositions.

In column 4 we use the truth table of ∧, applied to P and Q (so we ignore Rfrom column 3)

In column 5 we use the truth table for ∨, on columns 3 and 4, to get (P ∧ Q) ∨R

Another example - what is the truth table of (P ⊃ Q) ∧ (Q ⊃ P) ? We work it out like this

1P

2Q

3P ⊃ Q

4Q ⊃ P

5(P ⊃ Q) ∧ (Q ⊃ P)

F F T T T

F T T F F

T F F T F

T T T T T

Logic Page 8 of 27 Version 13/8/18

Page 9: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

In columns 1 and 2 we have the atoms, in all four combinations - these arethe 'inputs'

In column 3 we use the truth table of implication on P and Q

The same happens in column 4, but with Q and P not P and Q

Finally in column 5 we apply the truth table of conjunction, to columns 3 and 4.

We can learn something from this truth table. Column 5 is only true if P and Q are both false, or both true.

This means

(P ⊃ Q) ∧ (Q ⊃ P)

is the same as

P ~ Q

so we could write

((P ⊃ Q) ∧ (Q ⊃ P)) ~ (P ~ Q)

but this form is hard to read.

iff

Suppose

P ⊃ Q is true, and

Q is true. Does that mean P must be true? No, not for sure. If P is true, and P ⊃ Q, Q is true. But there may also be other circumstances under which Q is true.

For example

P could be 'n is 4'

and Q could be 'n is even'

Then 'n=4' implies 'n is even', so P ⊃ Q

But given 'n is even' we cannot conclude 'n is 4'. It could be 6, for example.

Suppose we can reverse the implication? Symbolically:

(P ⊃ Q) ∧ (Q ⊃ P), which is : P implies Q and Q implies P.

We worked out the truth table for that in the last section, and saw it meantthat P ~ Q, so that if (P ⊃ Q) ∧ (Q ⊃ P), then whenever P is true, Q is true,and vice versa.

We will write this as 'if', as an abbreviation of 'if and only if'

So 'P if Q' means if P is true, Q is true, and these are the only situations when Q is true.

So P if Q allows us to say

if P is true, Q is true

and also

if Q is true, P is true

Tautologies

What about the formula ¬( P ∧ ¬P) ? Its truth table is

P ¬P P ∧ ¬P ¬( P ∧ ¬P)

Logic Page 9 of 27 Version 13/8/18

Page 10: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

F T F T

T F F T

So ¬( P ∧ ¬P) is always true - whether P is true or false. That makes it a tautology.

A tautology is a formula which is true in all situations, no matter the truth values of its atoms.

¬( P ∧ ¬P) might be written in standard English 'a proposition cannot be both true and false'. In traditional logic, this was called the law of the excluded middle.

A tautology is also called a valid formula.

As another example, consider P ⊃ P

P P ⊃ P

F T

T TSo P ⊃ P is a valid formula. It is true for both truth values of P

⊨ A means 'A is a valid formula'. The ⊨ is not a logical connective - it does not have a truth table. It is just an abbreviation for 'is valid'.

⊨ A is not a sentence in the language of logic. It is a shorthand for a sentence in English - namely that A is a valid formula - that A is always true.

The following are some valid formulas - true for all truth values of A B and C, no matter what they are

1 A ⊃ ( B ⊃ A) If A is false, this is true. If A is true, then consider B ⊃ A. B false makes this true, as does B true and A true. So it is always true (or draw the truth table)

2 A ∧B ⊃ A If A ∧B is false, the implication is true. If true, A mustbe true, and the implication is also true

3 A ∧B ⊃ B

4 A ⊃ A ∨ B If A is false, its true. If A is true, A ∨ B is true

5 A ⊃ A

6 ¬ ¬ A ⊃ A

7 ¬A ⊃ (A ⊃ B) 'Denial of the antecedent'

8 A ⊃ B ~ (¬B ⊃ ¬A) 'Contraposition'

9 (A⊃B ∧ A) ⊃ B Modus ponens

10 (A⊃B ∧ ¬B) ⊃ ¬A Modus tollens

11 (A⊃B) ∧(B ⊃C) ⊃ (A⊃C)

'Hypothetical syllogism'

12 ¬A ∧ (A ∧ B) ⊃ B 'Disjunctive syllogism

13 A ⊃ (A ∨ B) Addition

14 (A ∧ B) ⊃ A Simplifcation

15 (¬A ∨B) ∧ (A ∧C) ⊃ (B∨C)

If A is false, C must be true. If A is true, B must be true. So B or C must be true. 'Resolution'

How could we persuade someone these actually are tautologies? There aretwo approaches - draw the truth table and see the last column is always

Logic Page 10 of 27 Version 13/8/18

Page 11: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

true, or reason from the connectives for all possible inputs (which in efect is the same thing, but a diferent psychological process).

For example for 7, denial of the antecedent:

A B ¬A A ⊃ B ¬A ⊃ (A ⊃ B)

F F T T T

F T T T T

T F F F T

T T F T T

Or, starting with ¬A ⊃ (A ⊃ B), A is either true or false, so..

If A is true, ¬A is false, so ¬A ⊃ (A ⊃ B) is true

If A is false, A ⊃ B is true, and the formula says true implies true, which is true.

So either way, ¬A ⊃ (A ⊃ B) is true.

Substitution Rule

Is ( P ∧ ¬ P) ⊃ ( P ∧ ¬ P ) a valid formula?

P ¬P P ∧ ¬P ( P ∧ ¬ P) ⊃ ( P ∧ ¬ P )

F T F T

T F F TSo, yes it is. However we did not need to work out the P ∧ ¬P column, because the yellow column has the form Q ⊃ Q, and we know this is valid, so must be all T anyway.

So we can start with a valid formula ( such as Q ⊃ Q ), then replace the atoms in it consistently with any other formula, and this produces another valid formula.

For example, start with ¬( P ∧ ¬P) (law of excluded middle). We know

⊨ ¬( P ∧ ¬P)

Replace P by Q ^ R, and we get

⊨ ¬( (Q ^ R) ∧ ¬(Q ^ R))

and we have another valid formula.

Truth table examples

1. Find the truth table of ¬P ∨Q,and compare it with P ⊃ Q

P Q ¬P ¬P ∨Q P ⊃ Q

F F T T T

F T T T T

T F F F F

T T F T TSo they are the same. Why? A false proposition implies any - so if P is false, the implication is true - so we have ¬P ∨.. If P is true ( ¬P is false ) then P ⊃ Q depends on Q - P ⊃ Q is true if Q is true, otherwise false. So

¬P ∨Q ~ P ⊃ Q

2 Is (¬P ∨Q) ∧( R ⊃ ( P ~ Q )) valid?

We work out the truth table and see if it is always true:

Logic Page 11 of 27 Version 13/8/18

Page 12: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

P Q R ¬P ¬P ∨Q P ~ Q R ⊃ ( P ~ Q ) (¬P ∨Q) ∧( R ⊃ ( P ~ Q ))

F F F T T T T T

F F T T T T T T

F T F T T F T T

F T T T T F F F

T F F F F F T F

T F T F F F F F

T T F F T T T T

T T T F T T T Tso it is not valid.

3. Is Q ⊃ (P ∨Q) valid?

P Q P ∨Q Q ⊃ P ∨Q

F F F T

F T T T

T F T T

T T T TSo this is valid. Why? Q is either false or true. If its false, Q ⊃ ..anything.. istrue. If Q is true, P ∨Q is true. So in both cases, Q ⊃ P ∨Q is true.

4. Show that (P ⊃ ¬P) ~ ¬P is valid

P ¬P P ⊃ ¬P (P ⊃ ¬P) ~ ¬P

F T T T

T F F TIf P is false, P ⊃... is true, and ¬P is also true.

If P is true, P ⊃ ¬P is true implies false, which is false, and ¬P is also false.

So in both cases (P ⊃ ¬P) and ¬P are the same.

5 Show ((P⊃Q) ⊃P) ⊃P is valid (Pierce's law, 1885 )

We could fnd the truth table as before, but there is a quicker way.

This has the form A ⊃ P, where A is (P⊃Q) ⊃P.

This is always true, except if A is true and P is false.

But if P is false, P⊃..anything.. is true, and A is 'true implies false', which is false.

So we cannot have A true and P false.

So ((P⊃Q) ⊃P) ⊃P is valid.

6 Show that (P ⊃ Q) ⊃ (¬Q ⊃ ¬P ) is valid (in classical logic, this is modus tollens )

This has the form A ⊃ B where A is P ⊃ Q and B is ¬Q ⊃ ¬P

For it to be not valid, we need to have A true and B false.

If B is false, then ¬Q is true and ¬P false

so P is true and Q false

Logic Page 12 of 27 Version 13/8/18

Page 13: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

but then A is false

Therefore it is always true.

¬Q ⊃ ¬P is the contrapositive of P ⊃ Q. A proposition implies its contrapositive.

We can check with the truth table:

P Q P ⊃Q ¬P ¬Q ¬Q ⊃ ¬P (P ⊃ Q) ⊃ (¬P ⊃ ¬Q )

F F T T T T T

F T T T F T T

T F F F T F T

T T T F F T T7 Show P ∨ Q ⊃ P ∧ Q is not valid

We need P ∨ Q true and P ∧ Q false. For example if P is true and Q false, P ∨ Q is true but P ∧ Q is false.

Intuitively, it says that if either P or Q are true, then both P and Q are true,which can clearly be wrong

8 Show (P⊃Q) ⊃ (Q ⊃ P) is not valid

This has the form A ⊃ B where A is P ⊃ Q and B is Q ⊃ P

Can we fnd A true and B false? Yes: if B is false, Q is true and P false

Then P ⊃ Q is true.

So (P⊃Q) ⊃ (Q ⊃ P) is not valid

Q ⊃ P is the converse of P⊃Q. A proposition does not imply its converse.

Questions

Answers at the end

1. Prove that ⊨A ⊃ ( B ⊃A)

2. Prove that ⊨ A ⊃ A ∨B

3. Is implication refexive? In other words, is A ⊃A valid?

4. Is implication transitive? In other words, is ((A ⊃ B) ∧ (B ⊃C) ) ⊃ ( A ⊃ C)valid?

5. Is ¬¬A ~ A valid? (double negation)

6. Prove that ⊨ A ∨¬A (law of the excluded middle - a proposition is either true or false, not both, not neither)

7. Prove that ⊨ ¬ (A ∨ B) ~ ¬A ∧ ¬B (De Morgan's Laws)

Logical equivalence

Two (compound) formulas A and B are logically equivalent if they have the same truth values, always. That is, no matter what the truth values of underlying atomic propositions, A and B have the same truth values.

For example, let A be P ∧Q

and B is ¬(¬ P ∨ ¬Q)

Logic Page 13 of 27 Version 13/8/18

Page 14: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

(so our underlying atomic propositions are P and Q). We work out the truthtable:

P Q P ∧Q ¬ P ¬Q ¬ P ∨ ¬Q ¬(¬ P ∨ ¬Q)

F F F T T T F

F T F T F T F

T F F F T T F

T T T F F F T

Whenever A is true, so is B, and when A is false, so is B. So A and B are logically equivalent. (this example is one of de Morgan's Laws)

So A and B being logically equivalent is the same is ⊨ A ∼ B

Another much simpler example: A and ¬ ¬ A are logically equivalent. So

⊨ A ∼ ¬ ¬ A

Chains of equivalences

Is equivalence transitive? If A ∼ B and B ∼C are both true, is A ∼C?

We'd guess so. We check:

A B C A ∼B B∼C (A ∼ B) ∧ (B ∼C) A ∼C (A ∼ B) ∧ (B ∼C) ) ∼ ( A ∼ C)

F F F T T T T T

F F T T F F F T

F T F F F F F T

F T T F T F F T

T F F F T F F T

T F T F F F F T

T T F T F F F T

T T T T T T T T

So the truth value of (A ∼ B) ∧ (B ∼C) is the same as A ∼C

Valid consequence

This is the key idea in mathematical logic, since it is the basis of proof.

Sentence B is a valid consequence of sentence A, if B is true whenever A istrue.

We illustrate this with an example. Suppose we have 2 atomic propositions, p and q, and form from them 2 sentences: A is p ∧q, and B is p∨q. The truth tables of these are:

p q A = p ∧q B = p ∨q A ⊃ B

F F F F T

F T F T T

T F F T T

T T T T TA is only true on one row, highlighted, and on that row B is also true. So if we know A is true, B must be true. So B is a valid consequence of A. (Or B is a logical consequence of A).

Logic Page 14 of 27 Version 13/8/18

Page 15: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

We can write this as A ⊫ B, read as A entails B.

Is this just the same as A implying B? No.

Suppose we know A⊃B is true - can we then conclude that B is true? No. Look at the green cells. There A⊃B is true, but A is false, and so is B.

If we know A⊃B is true, and that A is true, we can conclude B is true.

A second example.. again A and B are compound sentences, depending onsome underlying atomic propositions. We do not specify what they are, butwe consider all possible truth value combinations:

A B A⊃B A ∧(A⊃B)

F F T F

F T T F

T F F F

T T T TSo whenever A ∧(A⊃B) is true, B is true (the green row). So B is a valid consequence of A ∧(A⊃B).

That is A ∧(A⊃B) ⊨B

Why? If the left hand side is true, it means A is true, and also A⊃B - in which case B is true (in fact this is modus ponens again).

Implication and entailment

These ideas are confusing - here are the diferences:

Implication Entailment

also known as Material implicationMaterial consequenceConditional

Logical consequenceValid consequence

symbol (these not standard)

⊃ ⊫

language Propositional logic English or other natural language

type of term Logical connective Abbreviation

meaning See truth table A ⊫ B is shorthand for 'whenever A is true, B is true'

truth value see truth table Does not have one. A ⊫ B is not a proposition ( ⊫ is not a logical connective )

Inference rules

How do we decide if A ⊫ B? There are two methods:

1. Look at the truth table for A and B. ( Usually A and B will be compound sentences, based on a set of atomic propositions p,q,r..We need to consider all possible combinations of truth values of p,q,r..). If B is true whenever A is true, then A ⊫ B

2. Look at the structure of A and B, and match them to a known inference rule. For example A ∧(A⊃B) matches modus ponens, so it entails B

Logic Page 15 of 27 Version 13/8/18

Page 16: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

Some rules are listed below. They are written as for example:

a ⊃ b

a ⊃ ¬b

¬a

This shows two propositions which we assume to be true (premisses or axioms, a ⊃ b and a ⊃ ¬b . Then a horizontal line, and a fnal proposition,the conclusion. If the premisses are true, the conclusion is true:

a b a⊃b a⊃¬b ¬a

F F T T T

F T T T T

T F F T F

T T T F FThe shaded rows show that whenever a⊃b and a⊃¬b are true. ¬a is true. So the conclusion is a valid consequence of the premisses.

Logic Page 16 of 27 Version 13/8/18

Page 17: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

Name Symbolic form

Reductio ad absurdam r.a.d a ⊃ ba ⊃ ¬b ¬a

Alternative r.a.d a ⊃¬a¬a

Non-contradiction a¬a b

Double negation introduction a¬¬a

Double negation elimination ¬¬aa

Modus ponens a ⊃ ba b

Modus tollens a ⊃b¬b ¬a

Adjunction ab a∧b

Simplifcation a∧ba

Addition a a∧ b

Case analysis a ⊃ cb ⊃ ca ∨ bc

Disjunctive syllogism a ∨b¬ba

Constructive dilemma a ⊃ cb ⊃ da ∨ bc ∨ d

Hypothetical syllogism a ⊃ bb ⊃ ca ⊃ c

ProofThere are (at least) two aspects of proof - logical and psychological. We start with the logic:

In a proof, we have a set of propositions which we take to be true - these are called axioms or postulates or assumptions or premisses. Then we have a sequence of other propositions, which are valid consequences of the axioms, ending at some fnal proposition, which we have proved - that is, whenever the axioms are true, the proved proposition is true.

For example, a proof of proposition B:

Logic Page 17 of 27 Version 13/8/18

Page 18: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

Axiom 1: A⊃B

Axiom 2: A

Conclusion: B

This follows from what was shown in the previous section - B is a valid consequence of A and (A⊃B). That is, whenever A and A⊃B are true, then B is true. This pattern of proof was called in classical logic modus ponens.

This in fact is a proof schema - a proof pattern which when given actual propositions A and B gives a proof of B.

For example suppose A is 'x=4' and B is 'x+1=5'

then

Axiom 1: x=4 ⊃ x+1=5

Axiom 2: x=4

Conclusion: x+1=5

Another example

Axiom 1: A⊃B

Axiom 2: ¬B

Conclusion: ¬A

Why?

A B A⊃B ¬B ¬B ∧(A⊃B) ¬A

F F T T T T

F T T F F T

T F F T F F

T T T F F FOnly in the green row is ¬B ∧(A⊃B) true, and in it ¬A is true. So, ¬A is a valid consequence of ¬B ∧(A⊃B).

This pattern of reasoning is modus tollens again.

A third invalid example-

Axiom 1: A⊃B

Axiom 2: B

Conclusion: A

A B A⊃B B ∧(A⊃B)

F F T F

F T T T

T F F F

T T T T The green row is the problem. B ∧(A⊃B) is true, but A is false. So we cannot conclude from A⊃B and B that A is true. This error was called afrming the consequent.

Definitions

We need to have defnitions, since these form a basis for a proof. For a very simple example, if we have a theorem about even numbers, we must have a defnition of what 'even numbers' are - such as

Logic Page 18 of 27 Version 13/8/18

Page 19: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

A number n∊ℤ is even if there is an m∊ℤ such that n=2m

Then we can prove, say, that the sum of two even numbers is even, as follows:

Calling the two numbers a and b, then

a=2n and b=2m because they are even

so a+b = 2n + 2m = 2(n+m) because multiplication is distributive

so a+b is even

Is this a complete formal proof? No. The defnition of 'even' actually needs the language of predicate logic, which we have not yet looked at ( ∀x∊ℤ ∃n∊ℤ|x=2n~even(x) ). It also uses the distributivity on multiplication, which means we either have to include that as a premiss of the proof, and we need to include a proof that multiplication is actually distributive.

In defnitions, the 'if' is actually an 'if'. In other words both

n is even → n=2m

and

n=2m → n is even.

Why? Suppose it were not. Suppose we invent a term 'fourmul' (multiple offour) and try to defne it as:

n is a fourmul if n=2m

This is true - all multiples of 4 are even. But not all even numbers are multiples of 4 - so its useless as a defnition of fourmul. We need an if:

n is a fourmul if n=4m

We also need chains of defnitions. For example, our defnition of 'even' uses the terms ℤ and 2 and multiplication. Formally, we need defnitions ofthese. So a defnition of 'a' in terms of 'b' implies a need for a defnition of 'b' - and so on. This means we have a chain of defnitions, and either

the chain is a circle - we have a set of circular defnitions, which is bad, or

the chain is infnite, with no end, which is bad, or

the chain has some end point, using a term we do not defne.

In practice we use the last option, with the undefned terms being a 'set' and 'an element of'.

What the Tortoise said to Achilles

In 1895 the journal Mind published a paper with that title, by Lewis Carroll, author of the Alice novels. The paper has the Tortoise talking to Achilles. He points out the 'Euclidean relation'

1. Things that are equal to the same are equal to each other

2. The two sides of this triangle are equal to the the same

3. Therefore, the two sides of this triangle equal each other.

Achilles admits the conclusion logically follows from the premisses. He alsoadmits a person might accept the argument, but deny that 1 and 2 are true.

The Tortoise then asks Achilles if it could be that another person might accept 1 and 2 are true, but does not accept that 3 follows. Achilles agreesa person might say that. So the Tortoise writes

4. If 1 and 2 are true, 3 must be true

Logic Page 19 of 27 Version 13/8/18

Page 20: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

and asks whether the person would have to accept this as well. Achilles does so. Now the Tortoise has him. He writes

5. If 1 and 2 and 4 are true, 3 must be true.

Achilles must accept this. But then we have an infnite set of propositions to accept, the next being

6. If 1 and 2 and 4 and 5 are true, 3 must be true.

The paradox has been discussed by Bertrand Russell and Quine and others.

I would say that 3 is a logical consequence of 1 and 2, on the basis of our defnitions above, including what 'logical consequence' is.

Then the person who accepts 1 and 2 but denies 3 is psychologically unconvinced by the proof. They think it to be incorrect. So this is another aspect of proof, besides the logical one - the aspect of convincing someone that some conclusion is true.

Visual proofs

How could we prove the identity

(a-b)2 = a2-2ab+b2

? Like this:

The gray area is almost equal to the wholesquare ( a2 ) less twice the brown rectangle( 2ab ). But that subtracts b2 twice, so we needto add it back in again.

This is not a proof in the logical sense. But it isvery convincing, so is a proof in thepsychological sense.

Predicate CalculusThe classical Greek logicians had patterns of reasoning called syllogisms, such as:

Axiom 1: Socrates is a man

Axiom 2: All men are mortal

Conclusion: Socrates is mortal

We cannot deal with this in propositional logic, because it works as a resultof parts of propositions - both the axioms refer to 'men', and this link allows us to form a conclusion. But in propositional logic we never look 'inside' a proposition. We have atomic propositions like p, q, r and compounds like A = p ∨q - but cannot use what is actually inside atomic propositions.

Predicate calculus (aka predicate logic) extends proposition logic to deal with this.

As well as the logical connectives like conjunction and disjunction, it uses new ideas:

◦ predicates and terms

◦ quantifers and domains

◦ constants and variables

Logic Page 20 of 27 Version 13/8/18

Page 21: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

An example of a predicate is

.. is mortal

It corresponds to a clause in a sentence which gives something some property or attribute. Another predicate would be

.. is a man

A term stands for a 'thing'. A predicate is applied to a term, to get:

Socrates is mortal

or

Socrates is a man

This forms a proposition, which is true or false. The diference now is our propositions have parts - predicates and terms.

To be precise, 'Socrates is mortal' is a sentence in English, which is our meta language, while predicate calculus is now our object language. We will write predicates like

mortal(Socrates)

meaning 'Socrates is mortal'. We put the arguments to the predicate in brackets after it.

Another example:

even(28) where even() is the predicate 'is even'. Then even(28) is true, and even(7) is a false proposition.

Another predicate could be greater, meaning 'greater than'. So

greater(9,4) means 9 is greater than 4, so it is true, and greater(3,4) is false. But greater(4,3) is true, so the order of arguments makes a diference.

Our greater() predicate must have two arguments. This is its arity - the number of arguments it takes.

Quantifiers, variables and domains

We want to be able to express propositions like

All men are mortal.

We use ∀ to mean 'all'. This is the universal quantifer. But what is the term? We cannot say the name of all men. Instead we use a variable

∀x mortal(x)

which means 'for all x, x is mortal'. A variable is used in place of a constant, such as Socrates, Paris or 38. So a term is a constant or a variable.

But - all what x? It does not apply to all everything - mountains and clouds and planets are not mortal. We are talking about men. So the domain of discourse is men.

In general the domain of discourse is the set of all 'things' which are relevant to the discussion. So the domain might be all cats, or all people, or all integers greater than 1, and so on.

It is assumed the domain contains at least one item. This avoids problems like

'The present King of France is bald'

Logic Page 21 of 27 Version 13/8/18

Page 22: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

Bertrand Russell was concerned that since there was no 'present King of France', it was not possible to say the proposition was either true or false. If all domains have at least one element, we avoid that.

We usually use letters x,y and z as variables.

Another example

∀y barks(y)

where the domain is dogs, and this means 'all dogs bark' (which is a proposition, and it is probably false).

We can still use conjunction and so on, so we can construct propositions like

∀z dog(z) ⊃ barks(z)

where the domain is animals, and our proposition means 'if an animal is a dog, it barks'

A mathematical example:

∀n (even(n) ⊃ odd(n+1) )where the domain is the integers, even(n) means n is even, and odd(n) means n is odd. In other words, the number after an even number is odd.

Bound and free variables

In ordinary algebra, we might defne a function

f(x) = 2x+1

Compare that with

f(w) = 2w+1

Clearly these are the same function - you double the number and add 1. The x, or w, is just a 'place-holder', standing for the argument of the function.

Correspondingly compare

∀x P(x) everything has property P

∀w P(w) everything has property P

the x, or w, is 'used up' in the proposition. These are bound variables - just place holders, used up in the proposition.

We can also have free variables. For example

∀x P(x) ∧Q(y) everything has property P, and y has property Q

Here y is a free variable. Whether the proposition is true or false depends on what y is. This corresponds to

3a+1 = 7

Whether this is true or false depends on what 'a' is.

Precedence

In ordinary algebra, operations have 'precedence', which determines the order in which they are carried out. For example in 2 + 3 X 4 multiplicationhas higher precedence, so this is 2 + (3X4) =14, and not (2+3)X4 =20

Predicate calculus also have precedence rules, and ∀ has highest precedence. So for example

∀n (even(n) ∨ odd(n) ) means all numbers are even or odd, but

Logic Page 22 of 27 Version 13/8/18

Page 23: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

∀n even(n) ∨ odd(n) means all numbers are even, or n is odd. The second n here is a free variable, while the frst is bound. So this is the same as

∀m even(m) ∨ odd(n) all numbers are even, or n is odd. Whetherthis is true or false depends on what n is.

The quantifers are unary connectives, in that they apply to just one term, while conjunction, disjunction and implication are binary. This is therefore like unary minus, where

-2+3 means (-2)+3 = 1, not -(2+3) = -5

The existential qualifier

As well as 'All...' we want to be able to say 'Some..'. In other words, there is at least one thing that...

For this we use ∃ for 'there exists..'. So

∃x P(x) There exists something with the property P.

For example

∃n Even(n) Some numbers are even

In this example, n is a bound variable. So

∃m Even(m) Some numbers are even

No nothing nada

We want to be able to say something like 'Nobody is perfect'. This is asserting that no person is perfect. We do not have a special quantifer for this, since we can use the ¬ not connective:

¬ ∃x perfect(x)

This relates to

∃x perfect(x) Somebody is perfect

but it says this is false

¬ ∃x perfect(x) It is not true that somebody is perfect = Nobody is perfect

Or we can use the universal quantifer

∀x ¬ perfect(x) For all people, it is false that they are perfect

In general, 'No x is P' can be written

¬ ∃x P(x)

or

∀x ¬ P(x)

We can say other things in English, like 'Just a few x are..' or 'The majority of x are..'. It is not possible to express this in predicate calculus, since thisis concerned with propositions which are true or false, but

'Just a few x are P' means the proposition P(x) has a low probability of being true. This is outside predicate calculus, but is obviously a useful practical idea, and is used in fuzzy logic, developed by Łukasiewicz and Tarski and Zadeh.

Translating English

All cats are mammals ∀x(isCat(x) ⊃ isMammal(x) )

Logic Page 23 of 27 Version 13/8/18

Page 24: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

Some birds are brown ∃x(isBird(x) ∧ isBrown(x) )

Only bats fy (clearly false) ∀x(canFly(x) ⊃ isBat(x) )

No cats can fy ¬ ∃x(isCat(x) ∧ canFly(x)

Every dog like bones ∀x(isDog(x) ⊃ likesBones(x) )

Some cows have horns ∃x(isCow(x) ∧ hasHorns(x) )

Somebody likes everybody ∃x ∀y likes(x,y)

Everybody has a mother ∀x ∃y isMotherOf(y,x)

All sheep eat grass ∀x(isSheep(x) ⊃ eatsGrass(x) )

12 is divisible by 4 ∃n(equals12(4n))

13 is not divisible by 4 ¬∃n(equals13(4n))

For any m, if 12 is divisible by m, so is 24

∀m(∃n(equals12(mn)) ⊃∃n(equals24(mn))

23 is prime ∀n,m (equals23(nm) ⊃( (equals1(n) ∧ equals23(m)) ∨(equals1(m) ∧ equals23(n)))

Significance of 'true'

Recall our object language is logic, and our meta language is English - the language we use to talk about the object language. Suppose our meta language was Dutch, where 'true' is 'waar' and false is 'vals'.

So the truth table of disjunction, using v for false and w for true, is:

A B A ∨B

v v v

v w w

w v w

w w wFrom this point of view, true and false are simply two symbols. We can replace them, consistently, with another pair of symbols, and obtain identical patterns.

Compare that with the following scenario. A Stone Age man is wandering over a mountain-side when he encounters a cave. Can he shelter inside? He asks himself - 'Is it true that there is a bear in this cave?'. In this situation true and false are not simply a pair of arbitrary symbols. They have meaning - true meaning an actual correspondence with the state of the physical world, and false meaning a lack of such correspondence.

It seems reasonable that this idea of truth - which for our Stone Age man isa matter of life or death - has been extended metaphorically to the abstract notions with which mathematics is concerned. For example, Proposition 5 in Euclid's Elements is:

'For isosceles triangles, the angles at the base are equal to one another..'

We think this is true, in a sense that goes beyond simply one of a pair of arbitrary symbols. This is largely a psychological rather than a logical matter.

Logic Page 24 of 27 Version 13/8/18

Page 25: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

H P Grice and formal logic

We have seen in the case of 'if.. then..' and material implication, we sometimes have problems in clashes between normal language and logic. There are others problems with the same cause.

We start with an example:

Two people are driving in a car in a remote country location. The driver says 'We are running low on petrol'. The passenger says 'There is a petrol station in the next village'.

Now the driver will make two assumptions about what he hears, as follows

The passenger knows this is true, from evidence. He's not just guessing (orhe would have said 'Maybe...')

This is all he knows. For example, the passenger does not also know the petrol station closed down two years ago, but he chooses not to say that.

H.P.Grice was a philosopher of language, who noticed that listeners expected 4 things of speakers (so-called Grice's Maxims):

Tell the truth

Tell all you know

Be relevant

Be as clear as possible

Another example:

Normal person: 'How many children do you have?'

Mathematician: 'I have one child.'

Now in fact the mathematician has two children. But he argues that if he has two children, it is true that he has one child - so his statement was correct. But the normal person expected he would say all that he knew - soif he had two children he would have said so.

The Maxims make for efcient conversation. So that the passenger does not need to say 'It is true that there is a petrol station in the next village'. If we had to say 'It is true that.. X' life would be tedious. Hearers assume that saying 'X' is a quick way to say 'X is true'.

But not so in logic. If we have a sentence like

A ⊃B

then we are not saying A ⊃B is true. Its truth-value depends on the truth values of A and B. If A is true and B false, A⊃B is false. Compare that with

'For isosceles triangles, the angles at the base are equal to one another..'

where we are asserting this is true.

Answers

1. Prove that ⊨A ⊃ ( B ⊃A)

We need to show that the formula is true, whatever A and B are.

We could do it using the truth table

Logic Page 25 of 27 Version 13/8/18

Page 26: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

A B B ⊃A A ⊃ ( B ⊃A)

F F T T

F T F T

T F T T

T T T TSo A ⊃ ( B ⊃A) is always true.

Or we could reason as follows. A is true or false.

If false, A ⊃ ( A ⊃B) is true (a false proposition implies anything)

If true, then B ⊃A is true, no matter whether B is false or true, so A ⊃ ( B ⊃A) is true

So A ⊃ ( B ⊃A) is always true in either case.

2. Prove that ⊨ A ⊃ A ∨B

A is true or false. If false, A ⊃ A ∨B is true

If true, A ∨B is true, so A ⊃ A ∨B is true

So A ⊃ A ∨B is always true.

3. Is implication refexive? In other words, is A ⊃A valid?

A A ⊃A

F T

T TIf A is false, A ⊃A is true (false proposition implies anything)

If A is true, A ⊃A is true

Therefore implication is refexive.

4. Is implication transitive? In other words, is ((A ⊃ B) ∧ (B ⊃C) ) ⊃ ( A ⊃ C)valid?

A B C A ⊃B B⊃C (A ⊃ B) ∧ (B ⊃C)

A⊃C (A ⊃ B) ∧ (B ⊃C) ) ⊃ ( A ⊃ C)

F F F T T T T T

F F T T T T T T

F T F T F F T T

F T T T T T T T

T F F F T F F T

T F T F T F T T

T T F F F F F T

T T T T T T T TSo implication is transitive

5. Is ¬¬A ~ A valid? (double negation)

A ¬A ¬¬A ¬¬A ~ A

F T F T

T F T T6. Prove that ⊨ A ∨¬A (law of the excluded middle - a proposition is either true or false, not both, not neither)

Logic Page 26 of 27 Version 13/8/18

Page 27: Logic and Proof - maths.fyimaths.fyi/Logic/logic.pdf · actually are (except for their truth value) and we do not want to restrict to a single object language. P Q R are used for

A ¬A A ∨¬A

F T T

T F T7. Prove that ⊨ ¬ (A ∨ B) ~ ¬A ∧ ¬B (De Morgan's Laws)

A B A ∨ B ¬ (A ∨ B)

¬A ¬B

¬A ∧ ¬B

¬ (A ∨ B) ~ ¬A ∧ ¬B

F F F T T T T T

F T T F T F F T

T F T F F T F T

T T T F F F F TA ∨ B is always true except when A and B are both false

So ¬ (A ∨ B) is always false, except when A and B are both false

Which is what ¬A ∧ ¬B says.

Logic Page 27 of 27 Version 13/8/18