Sei sulla pagina 1di 57

2.

Propositional Calculus
Reference:
Grassmann and Tremblay, Chapter 1.
1
Propositional Calculus
Wikipedia: calculus (plural calculi) refers to any method or system of calculation
guided by the symbolic manipulation of expressions.
Proposition: a statement that is either true or false. Note that ambiguous and
meaningless statements are not propositions.
Hence, propositional calculus is the system for the symbolic manipulation of
statements that are either true or false.

Note that propositional calculus includes Boolean variable manipulation, as a
Boolean variable stores (usually implicitly) the truth of some statement. It also
includes logical reasoning, and expressing sound and unsound arguments.
Examples of propositions:
It is sunny.
x = 5 Note that = is used for equality, in mathematics and this course.
The following tree has height 3.
2
A proposition is often represented by a capital letter, a propositional variable. A
propositional variable can only take on the values T (True) and F (False). T and
F are the two propositional constants.
P: There are 90 students in this course.
P represents the proposition expressed by the statement.
The possible values for the variable P are T and F.

Q: This course is offered in room Arts 146.

When a proposition is expressed as a sequence of symbols, it is called a logical
expression.
e.g., P
P . Q



3
Logical connectives/operators can be used to combine propositions/logical
expressions to form new logical expressions.
Operators:
Negation (not, , ~)
A : the composite proposition has the opposite truth value as A.

Conjunction (and, .)
A . B : the composite proposition has truth value true
if both A and B are true, and otherwise it is false.
e.g., P . ( Q) : This course has 90 students, and is not in room Arts
146.

Disjunction (or, inclusive or, v)
A v B : the composite proposition has truth value true
if A or B or both have truth value true,
and otherwise it is false;
i.e., it is only false if both A and B are false.
e.g., P v ( Q) : This course has 90 students or is not in room Arts 146.
Note that the English statement is not as clear.
4
5
Truth Table: used to display the value of logical expressions as a function of
the values of their propositional variables. On the left, include all possible
combinations of the values for the variables.

The truth tables that define the basic operators:

A B A . B
T T T
T F F
F T F
F F F
A B A B
T T T
T F T
F T T
F F F
A A
T F
F T

The truth table for P v ( Q) is


















P Q Q P v ( Q)
T T F T
T F T T
F T F F
F F T T
6
Other operators
Conditional (if then, )
A B :







If it is raining, then it is cloudy.
If it is raining, the sun isnt shining.

If the first operand is F, then the composite proposition is always T
(independent of the second operand).
For any proposition P, F P and P T always have the value T.
Note that the symbol is an operator on propositions, and the
resulting proposition might be true or false. Some authors use instead of ,
and use for a different purpose. Be very careful reading other references.
the composite proposition has value false only when A
is true and B is false, otherwise it is true
A B A B
T T T
T F F
F T T
F F T
7
Other English ways to express the conditional P Q :
if P, then Q
if P, Q
P implies Q
P is sufficient for Q
whenever P, Q
Q if P
Q is implied by P
Q is necessary for P
P only if Q
For the compound proposition to be true,
cannot have P true unless Q is true, i.e., P only if Q.

8
Other operators (continued)
Biconditional (if and only if, equivalence, )
A B :








e.g., You will pass this course if and only if you learn the concepts of
the course.

Later it will be verified that A B is the same as (B A) . (A B)

Exclusive or (eor) A eor B is true if exactly one of A or B is true,
otherwise it is false
Not or (nor) A nor B is the same as (A v B)
Not and (nand) A nand B is the same as (A . B)


the composite proposition has value true when A and B
have the same truth value, otherwise it is false
A B A B
T T T
T F F
F T F
F F T
9
Translating English statements into propositional calculus.
Select the simple propositions of the sentence, and define a propositional
variable for each simple proposition. A proposition should not be negated.
Add the appropriate logical operators to obtain the expression for the English
statement.

Examples:
1) If Jim is in the barn, then Jack must be in the barn as well.
2) The getaway car was red or brown.
3) The news is not good.
4) You will be on time only if you hurry.
5) He will come if he has time.
10
Examples:
1) If Jim is in the barn, then Jack must be in the barn as well.
P: Jim is in the barn
Q: Jack is in the barn.
P Q
2) The getaway car was red or brown.
R: The getaway car was red
B: The getaway car was brown
R v B
3) The news is not good.
N: The news is good
N
4) You will be on time only if you hurry.
O: You will be on time
H: You hurry
O H
5) He will come if he has time.
C: He will come
H: He has time
H C
11
Show A eor B is the same as (A v B) . ( (A . B)).

Note that show generally means prove.

What does it mean for these two expressions to be the same?
This means that for any given (truth) values for the variables A and B,
truth values of the two expressions are the same.

How would one prove this?
One approach is to check the values of the expressions for every possible value
of A and B. This is easy done by building a truth table that includes the two
expressions, and then compare their columns.

Note that other approaches to the proof will be soon described.
12

Proof: Give a truth table for the two expressions, and verify that they always
have the same truth value.







The two columns for the two expressions
A eor B and (A v B) . ( (A . B))
are the same, so the two expressions always have the same value.
A B A eor B A v B A . B (A . B) (A v B) . ( (A . B))
T T F T T F F
T F T T F T T
F T T T F T T
F F F F F T F
13
Precedence rules
Highest precedence
.
v

Lowest precedence
For binary operators of equal precedence, do them in the order left to right.

e.g.,
A v B . C is the same as ( ( A) v (B . C) ).
A B v C D E . F is the same as
( ( (A (B v C)) ( D) ) (E . F) ).
A v B v C is the same as (( A v ( ( B)) ) v C).
(A v B) . ( (A . B)) is the same as (A v B) . (A . B).

When in doubt, use parenthesis.
14
Consider the following three statements
If it is cold, it is not snowing.
It snows only if it is not clear.
It is snowing.
Can they all be true?
Define appropriate propositional variables
CD : it is cold
SN : it is snowing
CL : it is clear

What is the logical expression corresponding to three statements all being true?

How does a person check that the logical expression can have the true value?
15
The logical expression corresponding to three statements all being true is
(CD SN) . (SN CL) . SN













Therefore, the three statements are simultaneously true only when CD is F, SN
is T, and CL is F, i.e., it is not clear and snowing, but it is not cold.

CD SN CL SN CD SN CL SN CL (CD SN) . (SN CL) . SN
T T T F F F F F
T T F F F T T F
T F T T T F T F
T F F T T T T F
F T T F T F F F
F T F F T T T T
F F T T T F T F
F F F T T T T F
16
The value of a logical expression that contains propositional variables depends
upon the assignments of truth values to the variables.

Tautology

If A is a tautology, the symbolic way to state this is
A
Note that is not an operator, it is a metasymbol to describe a propositional
expression. It is not part of a propositional expression.
Contradiction

Contingent

The logical expressions in the previous truth tables are all contingents, for
example the one on the previous slide. Most logical expressions are
contingents, but tautologies are very interesting and useful.
A logical expression that has value T for all possible
assignments.
A logical expression that has value F for all possible
assignments.
A logical expression that is neither a tautology nor a
contradiction.
17
Verify (A B) (A v B).

How would a person verify that this is a tautology?





18
Verify (A B) (A v B)

Build the truth table for the expression and verify the column is all Ts.








When P Q, then P is said to be logically equivalent to Q and it is written
as P Q.

Thus, A B A v B, and any occurrence of one can be replaced by the
other.



A B A B A A v B (A B) (A v B)
T T T F T T
T F F F F T
F T T T T T
F F T T T T
19
Verify the following (P Q) . (P Q) Q
This is called the law of cases.

How can this be verified?
20
Verify the following (P Q) . (P Q) Q

Build the truth table, and check that the column for the expression is all ts.







When A B, then A is said to be logically imply B, and it is written as
A ) B.

Thus, (P Q) . (P Q) ) Q, and in a sequence of logical implications, any
occurrence of the expression on the left-hand side can be replaced by the
expression on the right hand side.

Like , and ) are all metasymbols, not propositional operators.

P Q P Q P P Q (P Q) . (P Q) (P Q) . (P Q) Q
T T T F T T T
T F F F T F T
F T T T T T T
F F T T F F T
21
Theorem:
If A is a tautology with propositional variables P
1
, P
2
, , P
r
, and B
1
, B
2
,
, B
r
are arbitrary logical expressions, then the proposition obtained by
replacing each P
i
by B
i
results in another tautology.

Rational: Since A has value T independent of the values of the P
i
s, each P
i
can
be replaced by an arbitrary logical expression.

Note: A v A T, (check by building the truth table)
i.e., A v A T

Apply the theorem to the tautology (A B) (A v B) by substituting A for
A and substituting A for B.
(A B) (A v B) original tautology
(A A) (A v A) substitute A for A, and A for B
(A A) T use the logical equivalence A v A T
A A A A always has the value T

Therefore A ) A.
22
Contradictions:
If A is a tautology, then A is a contradiction.

P . P is a contradiction (check by truth table)
(A v B) . A . B is a contradiction
23
Laws (logical equivalences) that are useful for manipulating logical expressions
(Table 1.16 page 34 of Grassmann and Tremblay):
P v P T Excluded middle law
P . P F Contradiction law
----------------------------------------------------------------------------------------------------
P v F P Identity law
P . T P Identity law
----------------------------------------------------------------------------------------------------
P v T T Domination law
P . F F Domination law
----------------------------------------------------------------------------------------------------
P v P P Idempotent law
P . P P Idempotent law
----------------------------------------------------------------------------------------------------
( P ) P Double-negation law
----------------------------------------------------------------------------------------------------
P v Q Q v P Commutative law
P . Q Q . P Commutative law
24
Further Laws (logical equivalences):
(P v Q) v R P v (Q v R) Associative law
(P . Q) . R P . (Q . R) Associative law
----------------------------------------------------------------------------------------------------
P v (Q . R) (P v Q) . (P v R) Distributive law
P . (Q v R) (P . Q) v (P . R) Distributive law
----------------------------------------------------------------------------------------------------
(P v Q) P . Q De Morgan`s law
(P . Q) P v Q De Morgan`s law
----------------------------------------------------------------------------------------------------

All the laws can be checked by doing a truth table for each one.

The first 9 laws are very obvious.
The next 4, the communicative and associative laws, are same as normal
algebra for + and *.
Note that is also communicative and associative, but is neither.

The 2 distributive laws are the same as * distributing over +,
since a*(b+c) = a*b +a*c. However, note that + does not distribute over *.
De Morgan`s law has no analog with normal algebra.

25
Memorize the distributive and De Morgan`s laws, and know them by name.
Also, be very careful when applying them.

Note that the laws come in dual pairs (except the double-negative law).
The dual for a law is obtained by replacing v by ., replacing . by v, replacing T
by F, and replacing F by T. In this sense, the double-negative law is its own
dual.

Note that the laws do not consider or . They can be eliminated by the
following:
A B A v B proved earlier
** very important

A B (A B) . (B A) check by its truth table
(A v B) . (B v A) eliminating

A B (A . B) v (A . B) see slide 32

26
Example of using the laws.

F P . P Contradiction law
(A v B) . (A v B) Substitution A v B for P
(A v B) . (A . B) De Morgans law
(A v B) . A . B Associativity and precedence rules

(A v B) . A . B is a contradiction
27
Theorem:
Each of the following is an adequate set of connectives to express any
proposition:
i. ., v,
ii. .,
iii. v,
iv. nor
v. nand

Proof:
i. Given any arbitrary proposition, using the equivalences of 2 slides back,
and can be eliminated leaving only ., v, and .
ii. Start with an expression only using ., v,
Note that A v B (A v B) double-negation law
( A . B) De Morgans law
Therefore, all disjunctions and be replaced by conjunctions
and negations.
iii. Start with an expression only using ., v,
Note that A . B (A . B) double-negation law
( A v B) De Morgans law
Therefore, all conjunctions and be replaced by disjunctions
and negations.

28
iv. Start with an expression only using .,
Note
A nor A (A v A) definition of nor
(A) idempotent law
A
(A nor A) nor (B nor B) ( A) nor ( B) above equivalence
( A v B) definition of nor
A . B De Morgans law
A . B double negation
Use A A nor A
to eliminate all .
Use A . B (A nor A) nor (B nor B)
to eliminate all ..

v. Similar approach to that of nor can be used to eliminate nand.



29
A literal is a propositional variable or the negation of one.
e.g., P, P, Q

A logical expression is said to be in disjunctive normal form (DNF) if it is
written as a disjunction, in which all terms are conjunctions of literals.
e.g., (A . B) v (A . B),
(P.Q) v R v (Q.R.S) v W

Theorem:
Every logical expression can be expressed in disjunctive normal form.
Proof:
Basic idea: use v to combine all the ways to obtain true for the
expression.
Construct the truth table for the expression.
For every T in the column of the expression, form a conjunction of
literals, with one literal per variable where the literal expresses the truth of the
variable for that T. The disjunctive normal form is simply the disjunction of all
these conjunctions.


30
X Y Z A
T T T T
T T F F
T F T F
T F F T
F T T F
F T F F
F F T T
F F F F
A DNF of expression A is (X . Y . Z) v (X . Y . Z) v (X . Y . Z)

This does not necessarily yield the simplest DNF form for the expression.
Note that every logical expression can also be placed in conjunctive normal form
(CNF), i.e., a conjunction of terms, where each term is a disjunction of literals.
This can be done by .ing the negation of all the ways of getting F; i.e.,
(X.Y. Z) . (X.Y. Z) . (X.Y. Z) . (X.Y.Z) . (X.Y. Z)
(X v Y v Z) . (X v Y v Z) . (X v Y v Z) . (X v Y v Z) . (X v Y v Z)
Construction of disjunctive normal form (DNF) via truth table.

Consider an expression A involving variables X, Y and Z, and construct its truth table.
31
Suppose the objective is to prove a logical equivalence, say A B. Note that A
and B can be arbitrarily complex logical expressions.
There are three approaches that can be used to show logical equivalence:
i. Do the truth table for A B, and check that its column is all T.
ii. Do a truth table that includes A and B, and check that their columns are
the same.
iii. Use the equivalence laws to algebraically transform A into B, or visa
versa transform B into A. Alternatively, transform A into C, and B into C.


Often it is best to start with the most complex expression, and try to
transform it into the simpler one, or transform both of them into a
common simpler one.

In general, approach (iii) is the preferred approach. Moreover, if several
variables are involved, the truth table becomes too cumbersome, so
approach (iii) needs to be used.


32
Prove A B (A . B) v (A . B)
Proof: (using approach (iii))

How does one start?
33
Prove A B (A . B) v (A . B)
Proof: (using approach (iii))
A B (A B) . (B A) eliminate
(AvB) . (B v A) eliminate
((AvB) . B) v ((AvB) . A) distributive law
(B . (AvB)) v (A . (AvB)) commutative law
((B.A) v (B.B)) v ((A. A) v (A.B)) dist. law
((B.A) v F) v (F v (A.B)) contradiction law
(B.A) v (A.B) identity law
(A.B) v (A.B) commutative law
Hence, A B (A.B) v (A.B)

34
Normal Proofs
Objective: show premises imply conclusion
Approach:
start with the premises
develop results from premises and already established results
continue until reaching the conclusion
Key: use proper reasoning to develop each new result

Logic notation for a proof:
Suppose P
1
, P
2
, , P
r
are the logical expressions of the premises
C is the logical expression of the conclusion
This is written as P
1
, P
2
, , P
r
C

To use the symbol, the reasoning must be logically correct, i.e.,
sound.
This appears to be a second use of the symbol . However, a
standard tautology is a conclusion that is logically implied with no premises.
Hence, the previous use is a special case of this use.

35

Two proof approaches to show P
1
, P
2
, , P
r
C :

i. Show P
1
. P
2
. . P
r
) C,
i.e., P
1
. P
2
. . P
r
C
i.e., P
1
. P
2
. . P
r
C is a tautology

ii. Show P
1
. P
2
. . P
r
. C is a contradiction
Justification:
P
1
. P
2
. . P
r
C is a tautology
(P
1
. P
2
. . P
r
C) is a contradiction
((P
1
. P
2
. . P
r
) C) is a contradiction precedence rules
( (P
1
. P
2
. . P
r
) v C) is a contradiction A B A v B
(P
1
. P
2
. . P
r
) . C is a contradiction (A v B) A . B
(P
1
. P
2
. . P
r
) . C is a contradiction A A
P
1
. P
2
. . P
r
. C is a contradiction associativity

How do we show an expression is a tautology or a contradiction?
36
Methods to verify that a logical expression is a tautology/contradiction:

I. Truth table
Prove A, A B B This important result is called Modus ponens
(method of assertion).
i.e., (A . (A B)) ) B
approach: show (A . (A B)) B is a tautology

aggregate
variables premises premises conclusion validity






Therefore, A, A B B

A B A A B A . (A B) B (A . (A B)) B
T T T T T T T
T F T F F F T
F T F T F T T
F F F T F F T
37
Prove B, A B A This important result is called Modus
tollens (method of denial).
approach: show B . (A B) . A is a contradiction

aggregate
variables premises premises validity






Therefore, B, A B A.
A B B A B B . (A B) B . (A B) . A
T T F T F F
T F T F F F
F T F T F F
F F T T T F
38
Methods to verify that a logical expression is a tautology/contradiction:
II. Formal proofs / derivations
The use of truth tables to proof all results is often too cumbersome.
Instead,
i. Develop and verify rules of inference (by truth tables)
ii. Use the rules of inference to prove new results


Note that modus ponens and modus tollens are 2 important rules of
inference.

Suppose that L is a list of rules of inference, and from premises P
1
, P
2
,
, P
r
a sequence of arguments (a derivation) can be made using the
rules of inference from L that lead to conclusion C, then we say that C
can be derived from P
1
, P
2
, , P
r
using L, i.e.,
P
1
, P
2
, , P
r

L
C.

If all the rules of inference used are sound, then we can conclude
P
1
, P
2
, , P
r
C.

39
Main rules of inference (Table 1.25 page 50 of Grassmann and Tremblay):
A, B A . B Law of combination (C)
A . B B Law of simplification (S)
A . B A Law of simplification (S)
A A v B Law of addition (A)
B A v B Law of addition (A)
A, A B B Modus ponens (MP)
B, A B A Modus tollens (MT)
A B, B C A C Hypothetical syllogism (HS)
A v B, A B Disjunctive syllogism (DS)
A v B, B A Disjunctive syllogism (DS)
A B, A B B Law of Cases (Cs)
A B (A B) Equivalence elimination (Ee)
A B (B A) Equivalence elimination (Ee)
A B, B A A B Equivalence introduction (Ei)
A, A B Inconsistency law (I)

When this list is used, the subscript on
L
is normally dropped.

40
Examples of formal proofs/derivations:
Prove A B, A B
i.e., A B, A B

Formal derivation Rule Comments
1. A B Premise
2. A Premise
3. A B 1, Ee
4. B 2, 3, MP conclusion
A B, A B
A B, A B Only used standard rules of inference


Prove P v R, W . S, (W . Q) P, S R Q

41
Prove P v R, W . S, (W . Q) P, S R Q
Formal derivation Rule Comments
1. P v R premise
2. W . S premise
3. W . Q P premise
4. S R premise
5. S 2, S
6. R 5, 4, MP
7. P 6, 1, DS
8. (W . Q) 7, 3, MT
9. W v Q 8, De Morgans law
10. W 2, S
11. Q 10, 9,DS
12. Q 11, double negation

P v R, W . S, (W . Q) P, S R Q
P v R, W . S, (W . Q) P, S R Q
since only used standard rules of inference

42
A fallacy is an unsound argument or an inference rule or rules that are not
sound.
e.g., P v Q ) Q fallacy
P Q, Q ) P fallacy
If there is an error on the computer chip (P)
then my program wont run correctly (Q),
i.e., P Q

My program isnt running correctly (Q)

There is an error on the computer chip (P)
ERROR: used an unsound argument.


A system, the set of derivations possible using a given list L, is called sound if
L does not contain any fallacies.

The system for the list on the slide 39 is sound.

43
A system is called complete if for every set of premises, the system can derive
every conclusion that logically follows from the premises.

The system for the list on slide 40 is not complete. For example, it cannot
derive any tautology, since all the laws have premises while a tautology does
not. However, the system formed by above list together with the Deduction
Theorem (see next slide) is complete.

If a logical system is sound, then A B only if A B.
If a logical system is complete, then A B if A B.
Thus, for a sound and complete system, A B if and only if A B.

Our formal proofs will use the list on the previous slide plus the Deduction
Theorem, a sound and complete system. Informal proofs are also based on
these laws.
44
The Deductive Theorem is the approach to use in the proof of a result where
the conclusion has the form B C.

Deduction Theorem (DT)
Let B and C be two expressions, and let P
1
, P
2
, , P
r
be premises. If B, P
1
,
P
2
, , P
r
together logically imply C, then P
1
, P
2
, , P
r
logically imply
B C,
i.e., P
1
, P
2
, , P
r
) B C.

Pattern for the use of the Deductive Theorem:
i. Assume B.
ii. Prove C, using B if necessary.
iii. Discharge B, which means that B is no longer necessarily true,
and conclude B C.

Prove A B, B C A C (Hypothetical syllogism)

45
Prove A B, B C A C (Hypothetical syllogism) using the Deductive
Theorem.

Formal derivation Rule Comments
1. A B premise
2. B C premise
3. A assumption
4. B 1, 3, MP
5. C 2, 4, MP
6. A C 3, 5, DT Discharge A


A B, B C A C
A B, B C A C since only sound rules were used.


Prove P Q Q P Contrapositive law
What needs to be shown?

46
Prove P Q Q P
What needs to be shown?
Recall A B is logically equivalent to A B
which is equivalent to (A B) . (B A).
Therefore, we need to show ((P Q) (Q P))
. ((Q P ) (P Q)).
Hence, we need to show both (P Q) (Q P)
and (Q P ) (P Q).

To prove (P Q) (Q P) using the deductive theorem,
what needs to be assumed?
what needs to be shown?
to show this using the deductive theorem,
what is assumed?
what is shown?
47
Prove P Q Q P
Formal derivation Rule Comments
First show (PQ)(QP)
1. P Q assumption Premise of subproof
2. Q assumption Now show Q P
3. P 1, 2, MT
4. Q P 2, 3, DT Discharge Q
5. (P Q) (Q P) 1, 4, DT Discharge P Q

Next show (QP)(PQ)
6. Q P assumption Premise of subproof
7. P assumption Now show PQ
8. Q Q 6, 7, MT
9. P Q 7, 8, DT Discharge P
10. (Q P) (P Q) 6, 9, DT Discharge Q P

6. PQ QP 5, 10, Ei

P Q Q P

48
Indirect proof
Objective is to show A is true.

Pattern of the proof:
i. Assume A.
ii. Prove that this assumption leads to a contradiction.
iii. Discharge A, and conclude A is true.

Additional Rule of Inference law
A F A Indirect proof

Proof of the indirect proof rule
Formal derivation Rule Comment
1. A F premise
2. T always holds
3. F 2, T F
4. A 1, 3, MT
A F A

49
Prove A B, A B B (Law of Cases)

Use the indirect proof approach.

Formal derivation Rule Comments
1. A B premise
2. A B premise
3.

. . .


B indirect proof

50
Prove A B, A B B (Law of Cases)

Formal derivation Rule Comments
1. A B premise
2. A B premise
3. B assumption Try for a contradiction
4. A 1, 3, MT
5. A 2, 3, MT
6. A 5, double negative
7. A . A 4, 6, C
8. F 7, contradiction law Contradiction
9. B 3, 8, indirect proof Discharge B


A B, A B B
A B, A B B

Note that any assumption made during a proof must be discharged. Also, any
result obtained between the assumption and the discharge (not including the
result obtained in the discharge line) is also discharged and cannot be used in
the rest of the proof.
51
Knights and knaves puzzle (Raymond Smullyan)

Knights always tell the truth.
Knaves always lie.

You meet two individuals, A and B, each of whom is either a knight or a knave.
Individual A says: B is a knight.
Individual B says: I am the opposite type than A.

Can you tell the type of A and/or B?
If so, what are their types?

Let A be the statement: Individual A is a knight.
Let B be the statement: Individual B is a knight.

Premises:
??


52
Knights and knaves puzzle (Raymond Smullyan)

Knights always tell the truth.
Knaves always lie.

You meet two individuals, A and B, each of whom is either a knight or a knave.
Individual A says: B is a knight.
Individual B says: I am the opposite type than A.

Let A be the statement: Individual A is a knight.
Let B be the statement: Individual B is a knight.

Premises:
A B A is truthful iff As statement is true
B (A.B) v (A.B) B is truthful iff Bs statement is true

With these premises, it is hard to know where to start a formal derivation. In
such cases, an indirect proof is often the easiest.

If an indirect proof is used, what should be assumed?

53
Formal derivation Rule Comments
1. A B premise
2. B (A.B) v (A.B) premise
3. A assumption Try to obtain contradiction
4. A B 1, Ee
5. B 4, 5, MP
6. B (A.B) v (A.B) 2, Ee
7. (A.B) v (A.B) 5, 6, MP
8. B 5, double negation
9. A v B 8, A
10. (A . B) 9, De Morgans law
11. A . B 7, 10, DS
12. A 11, S
13. A . A 3, 12, C
14. F 13, contradiction law Contradiction
15. A 3, 14, indirect proof Discharge A
16. B A 1, Ee
17. B 15, 16, MT
18. A . B 15, 17, C

A is a knave, and B is a knave.
Check that all the premises are satisfied for this assignment.


54
Alternate, non-Formal Derivation, proofs for knights and knaves problem:
I.Premises:
(i) A B
(ii) B (A.B) v (A.B)
Since A B, either one can replace the other one.
In (ii), replace A by B to obtain
B (B.B) v (B.B)
F v F Contradiction law
F Identity law
B
But, B and A B implies A by modus tollens.
A . B

II.Premises:
(i) A B
(ii) B (A B)
Using modus tollens, C, B C B.
Take C to be (A B), and apply modus tollens.
B
Again, B and A B implies A, and therefore A . B.



55
Let A and B be logical expressions.
To prove:
A B assume A, derive B, and use DT (Deduction Theorem)
A prove A, direct proof
or assume A and derive F (i.e., obtain a contradiction)
indirect proof (IP), or proof by contradiction
A . B prove A, then prove B, then apply the law of combination
A v B either prove A or prove B, then apply the law of addition
If expressions A and B are related,
it may not possible to independently prove A or prove B.
or assume A and derive B, i.e., use A v B ( A B) and DT
or assume B and derive A , i.e., use B v A ( B A) and DT
Note the implications are the contrapositive of each other.
A B prove A B and prove B A , then use equivalence introduction,
or use a sequence of logical equivalences to derive one from the other

Note that any assumption made during a proof must be discharged, and either
proves an implication that follows from the assumption, or yields a contradiction
which proves the negation of the original assumption.

56
To prove A > B, or A B, or A B (all equivalent)
Use truth tables (only possible for small expressions)
Use formal derivation by inference rules and logical equivalences
Formal Derivation Rule Comment
1. A premise or assume A
2. lines and inference rule or equivalence
lines and inference rule or equivalence
x. B lines and inference rule or equivalence

To prove A B, or A B
Use truth tables (only possible for small expressions)
Use formal derivation to prove A B, and to prove B A
Use logical equivalences
A . equivalence rule
. equivalence rule
B equivalence rule

Later well see more (less formal) proof techniques.

57

Potrebbero piacerti anche