Logic - University of Manchester · Chapter 1 Logic 1.1 Introduction and Deflnitions Deflnitions....

7

Click here to load reader

Transcript of Logic - University of Manchester · Chapter 1 Logic 1.1 Introduction and Deflnitions Deflnitions....

Page 1: Logic - University of Manchester · Chapter 1 Logic 1.1 Introduction and Deflnitions Deflnitions. A sentence (statement, proposition) is an utterance (that is, a string of characters)

Chapter 1

Logic

1.1 Introduction and Definitions

Definitions. A sentence (statement, proposition) is an utterance (that is, a string of characters) whichis either true (T) or false (F). A predicate is a property that a variable (or a list of variables) might have;a predicate in the variables x1, . . . , xn returns a value T or F for each choice of values of x1, . . . , xn.

Example. Let φ(n) denote “n is prime”. Then φ is a predicate; φ(17) is a true sentence and φ(4) is afalse sentence. Also, “if n is an integer, then φ(n)” is a false sentence.

Definitions. A predicate is said to be a compound sentence if the variables of the predicate are proposi-tions. Given a compound sentence, all possible truth inputs can be inserted, and the corresponding truthoutcomes listed. Such a list is known as a truth table.

1.2 Logical Connectives

Let p and q be sentences. The following definitions are made.

• Disjunction: p ∨ q is true if at least one of p, q is true, and false if both p, q are false. The truthtable for disjunction is as follows.

p q p ∨ qT T TT F TF T TF F F

• Conjunction: p ∧ q is true if both p, q are true, and false if at least one of p, q is false. The truthtable for conjunction is as follows.

p q p ∧ qT T TT F FF T FF F F

• Negation: ¬p is false if p is true, and true if p is false. The truth table for negation is as follows.

p ¬pT FF T

3

Page 2: Logic - University of Manchester · Chapter 1 Logic 1.1 Introduction and Deflnitions Deflnitions. A sentence (statement, proposition) is an utterance (that is, a string of characters)

• Implication: p → q means (¬p) ∨ q. The truth table for implication is as follows.

p q ¬p (¬p) ∨ qT T F TT F F FF T T TF F T T

Note that q ← p is the same as p → q.

• Equivalence: p ←→ q means (p → q)∧(q → p), “p if and only if q”. The truth table for equivalenceis as follows.

p q p → q q → p p ←→ qT T T T TT F F T FF T T F FF F T T T

Examples. Let p and q be sentences.

1. Consider the compound sentence p ∨ (p → (¬q)). The truth table is as follows.

p q ¬q p → (¬q) p ∨ (p → (¬q))T T F F TT F T T TF T F T TF F T T T

Hence, this compound sentence is always true.

2. Consider the compound sentence p ∧ (q → (p ∨ q)). The truth table is as follows.

p q p ∨ q q → (p ∨ q) p ∧ (q → (p ∨ q))T T T T TT F T T TF T T T FF F F T F

,

whence p ∧ (q → (p ∨ q)) has the same outcomes as p.

Definitions. Two compound sentences, P and Q, are said to be logically equivalent if P and Q have thesame truth tables, written P ≡ Q. A compound sentence that is true for all values of the inputs is calleda tautology. A compound sentence that is always false is called a contradiction.

Examples. Let p and q be sentences

1. As above, p ∨ (p → (¬q)) is a tautology.

2. Also from above, p ∧ (q → (p ∨ q)) ≡ p.

3. Let p and q be sentences and consider the compound sentence p ∨ (p → q). The truth table is asfollows.

p q p → q p ∨ (p → q)T T T TT F F TF T T TF F T T

Hence, p ∨ (p → q) is a tautology.

4

Page 3: Logic - University of Manchester · Chapter 1 Logic 1.1 Introduction and Deflnitions Deflnitions. A sentence (statement, proposition) is an utterance (that is, a string of characters)

4. Consider the compound sentence p ∨ (¬p). The truth table is as follows.

p ¬p p ∨ (¬p)T F FF T F

Hence, p ∨ (¬p) is a tautology.

5. Consider the compound sentence p ∧ (¬p). The truth table is as follows.

p ¬p p ∧ (¬p)T F FF T F

Hence, p ∧ (¬p) is a contradiction.

6. Consider the compound sentence p → (¬p). The truth table is as follows.

p ¬p p → (¬p)T F FF T T

7. Finally, consider the compound sentence p → (p ∨ q). The truth table is as follows.

p q p ∨ q p → (p ∨ q)T T T TT F T TF T T TF F F T

Hence, p → (p ∨ q) is a tautology.

Definitions. Let p and q be sentences. The following terminology is used:

1. “if p then q” means p → q;

2. “q if p” means p → q;

3. “p is a sufficient condition for q” means p → q;

4. “p is a necessary condition for q means q → p;

5. “p unless q” means (¬p) → q, that is, p ∨ q;

6. “either p or q” means (p ∨ q) ∧ (¬(p ∧ q)) – known as exclusive or.

Remark. In common usage, “either . . . or” is often used for emphasis, when inclusive or is intended.

Definitions. A definition is an agreement to assign a certain name to those x that make a certainpredicate true (the “if” is a definition is really an “if and only if” – sometimes written in short form as“iff”). An axiom is an agreement to make a certain statement true.

Theorem. Let P and Q be compound sentences. Then P ≡ Q if and only if P ←→ Q is a tautology.

Proof. Assume firstly that P ≡ Q. Then for any truth inputs, P and Q are both true or both false, soP ←→ Q is true, so P ←→ Q is a tautology. Conversely, assume that P ←→ Q is a tautology. Then, forany inputs, P ←→ Q is true, so P and Q are both true or both false, so P and Q have the same truthtable, so P ≡ Q.

Lemma. For any sentence p, ¬(¬p) ≡ p.

Proof. Consider the following truth table.

p ¬p ¬(¬p)T F TF T F

The first and third columns agree, so ¬(¬p) ≡ p as required.

5

Page 4: Logic - University of Manchester · Chapter 1 Logic 1.1 Introduction and Deflnitions Deflnitions. A sentence (statement, proposition) is an utterance (that is, a string of characters)

1.3 De Morgan’s Laws and the Distributive Laws

Theorem (De Morgan’s Laws). Let p, q and r be sentences. Then De Morgan’s laws state that

• ¬(p ∨ q) ≡ (¬p) ∧ (¬q);

• ¬(p ∧ q) ≡ (¬p) ∨ (¬q).

Proof. For the first law, consider the following truth table.

p q p ∨ q ¬(p ∨ q) ¬p ¬q (¬p) ∧ (¬q)T T T F F F FT F T F F T FF T T F T F FF F F T T T T

Hence ¬(p ∨ q) and (¬p) ∧ (¬q) have the same truth table, so ¬(p ∨ q) ≡ (¬p) ∧ (¬q), as required. Thesecond law may be deduced from the first law. If p ≡ ¬P and q ≡ ¬Q are substituted into the first law,then

¬ ((¬P ) ∨ (¬Q)) ≡ P ∧Q.

Negating this equivalence and using ¬(¬r) ≡ r now gives

(¬P ) ∨ (¬Q) ≡ ¬(P ∧Q),

as required.

Theorem (The Distributive Laws for Propositions). Let p, q and r be propositions. Then, the distributivelaws state that

• p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r);

• p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r).

Proof. The first law can be proved by considering the following truth table.

p q r q ∨ r p ∧ (q ∨ r) p ∧ q p ∧ r (p ∧ q) ∨ (p ∧ r)T T T T T T T TT T F T T T F TT F T T T F T TF T T T F F F FF F T T F F F FF T F T F F F FT F F F F F F FF F F F F F F F

The second law may also be proved by means of a truth table. Alternatively, forming the negation ofeach side of the first law, and using De Morgan’s laws, gives

¬ (p ∧ (q ∨ r)) ≡ ¬ ((p ∧ q) ∨ (p ∧ r))∴ (¬p) ∨ (¬(q ∨ r)) ≡ (¬(p ∧ q)) ∧ (¬(p ∧ r))

∴ (¬p) ∨ ((¬q) ∧ (¬r)) ≡ ((¬p) ∨ (¬q)) ∧ ((¬p) ∨ (¬r)).

Replacing p by ¬P , q by ¬Q and r by ¬R now gives

P ∨ (Q ∧R) ≡ (P ∨Q) ∧ (P ∨R),

and since p, q and r were arbitrary sentences, the second law follows as required.

Example. For sentences p and q,

¬(p → q) ≡ ¬((¬p) ∨ q) ≡ ¬(¬p) ∧ (¬q) ≡ p ∧ (¬q).

6

Page 5: Logic - University of Manchester · Chapter 1 Logic 1.1 Introduction and Deflnitions Deflnitions. A sentence (statement, proposition) is an utterance (that is, a string of characters)

Remark. Suppose that p(x) and q(x) are predicates. Then, p(x) → q(x) should mean that for all x suchthat p(x) is true, q(x) is also true. If p(x) → q(x) is false, then there are some instances of p(x) beingtrue but q(x) being false, that is, there exists an x for which p(x) ∧ (¬q(x)).

Remark. It is possible to call the truth values 0 (for false) and 1 (for true). If this convention is adopted,then

• ¬ makes 1 into 0, and 0 into 1, so ¬p is 1− Truth(p).

• p → q means that “q is at least as true as p” or

Truth(q) ≥ Truth(p).

• p ∧ q has truth value min(Truth(p), Truth(q)), or even just Truth(p). Truth(q).

• p ∨ q has truth value max(Truth(p), Truth(q)) or even Truth(p) + Truth(q), but 1 + 1 = 1 in thiscase.

This makes the system of truth values into what is called a Boolean Algebra. This actually proves thatthe propositional calculus is complete; that is, given a phrase X in propositional calculus it is alwayspossible to answer the question “is X a tautology?” by writing out truth tables.

1.4 Standard Methods of Argument

Let p and q be sentences. The following are some standard methods of argument.

• Reductio ad absurdum: ((¬p) → q) ∧ (¬q)) → p is a tautology.

• Proof by Contraposition: (p → q) ≡ (¬q) → (¬p)

• Modus Ponens (Method of Placing): (p ∧ (p → q)) → q is a tautology.

Proof.

• Recall that p → q ≡ (¬p) ∨ q.Hence,

((¬p) → q) ∧ (¬q)) → p ≡ ¬ (((¬p) → q) ∧ (¬q)) ∨ p

≡ ¬((p ∨ q) ∧ (¬q)) ∨ p

≡ ¬((p ∧ (¬q)) ∨ (p ∧ (¬q))) ∨ p

≡ ¬(p ∧ (¬q)) ∨ p

≡ (¬p) ∨ q ∨ p

≡ T.

Thus, ((¬p) → q) ∧ (¬q)) → p is a tautology.

• In this case,(¬q) → (¬p) ≡ ¬(¬q) ∨ (¬p) ≡ q ∨ (¬p) ≡ (¬p ∨ q ≡ p → q.

• In this case,

(p ∧ (p → q)) → q ≡ ¬(p ∧ (p → q)) ∨ q

≡ ¬(p ∧ (¬p ∨ q)) ∨ q

≡ ¬((p ∧ (¬p) ∨ (p ∧ q)) ∨ q

≡ ¬(p ∧ q) ∨ q ≡ (¬p) ∨ (¬q) ∨ q

≡ T.

Hence, (p ∧ (p → q)) → q is a tautology, as required.

7

Page 6: Logic - University of Manchester · Chapter 1 Logic 1.1 Introduction and Deflnitions Deflnitions. A sentence (statement, proposition) is an utterance (that is, a string of characters)

Remarks.

• The first method above is “argument by contradiction”.

• ¬q → ¬p is sometimes easier to prove than p → q.

• Since ¬(¬p) ≡ p, in order to prove p, it is sometimes easier to disprove ¬p.

Definitions. Suppose that φ is a predicate in one variable. Then ∀x φ(x) means “φ(x) is true for everyvalue of the variable x”, and ∃x φ(x) means “φ(x) is true for some value of the variable x”. The symbol∀ is called the universal quantifier, and the symbol ∃ is called the existential quantifier.

Example. If ψ is a predicate in three variables, then ∀x∃y∀zψ(x, y, x) is a proposition and ∀x∃yψ(x, y, z)is now a predicate in one variable.

Definition. In an example such as the above, the variables preceded by a quantifier are known as “boundvariables” and the other variables are known as “free variables”.

Remark. To disprove ∀x φ(x) it is just necessary to find (at least) one x for which φ(x) is false; suchan x is called a counterexample.

1.5 Forming the Negation of a Statement

Lemma. Let φ be a predicate in one variable. Then,

• ¬(∀x φ(x)) ←→ (∃x ¬φ(x));

• ¬(∃x φ(x)) ←→ (∀x ¬φ(x)).

Proof. Firstly, ¬(∀xφ(x)) is true if and only if there is a counterexample, that is, if and only if ∃x¬φ(x).Similarly, ¬(∃x φ(x)) is true if and only if φ(x) is never true, that is, if and only if ∀x ¬φ(x).

Remarks.

1. The notation 6 ∃ is sometimes used to mean ¬∃, but the notation 6 ∀ is seldom seen.

2. If an expression contains several quantifiers, then in general their order is important. However, twoconsecutive universal quantifiers may be interchanged, as may two consecutive existential quantifierscan be interchanged. For example,

• ∀x∀y φ(x, y) ≡ ∀y∀x φ(x, y);

• ∃x∃y φ(x, y) ≡ ∃y∃x φ(x, y);

• ∃x∀y φ(x, y) → ∀y∃x φ(x, y);

• ∃y∀x φ(x, y) → ∀x∃y φ(x, y),

but generally, one cannot write ←→ in the last two expressions.

Examples. Let m, n be integer variables and let φ(m,n) be the predicate “m = 1+n2”. Then ∀n∃mφ(m, n)is true and ∀m∃n φ(m,n) is false; m = 3 gives a counterexample. Also, ∃m∀n φ(m,n) is false; whateverm is, the equation m = 1 + n2 has at most 2 solutions n.

Two or More Quantifiers

Consider the following illustrative examples.

1.¬(∀x∃y φ(x, y)) ←→ ∃x ¬(∃y φ(x, y)) ←→ ∃x∀y ¬φ(x, y)

2.¬(∀x∀y φ(x, y)) ←→ ∃x ¬(∀y φ(x, y)) ←→ ∃x∃y ¬φ(x, y)

8

Page 7: Logic - University of Manchester · Chapter 1 Logic 1.1 Introduction and Deflnitions Deflnitions. A sentence (statement, proposition) is an utterance (that is, a string of characters)

3. Let f : R→ R be a function, and a ∈ R. The statement “f is continuous at a” means

∀ε > 0 ∃δ > 0 ∀x ∈ R (|x− a| < δ → |f(x)− f(a)| < ε).

By negation, the statement “f is not continuous at a” may be formulated. Then, f is discontinuousat a if and only if

¬(∀ε > 0 ∃δ > 0∀x ∈ R (|x− a| < δ → |f(x)− f(a)| < ε))←→ ∃ε > 0 ¬(∃δ > 0 ∀x ∈ R (|x− a| < δ → |f(x)− f(a)| < ε))←→ ∃ε > 0 ∀δ > 0 ¬(∀x ∈ R (|x− a| < δ → |f(x)− f(a)| < ε))←→ ∃ε > 0 ∀δ > 0 ∃x ∈ R ¬(|x− a| < δ → |f(x)− f(a)| < ε)←→ ∃ε > 0 ∀δ > 0 ∃x ∈ R ¬(¬(|x− a| < δ) ∨ (|f(x)− f(a)| < ε)←→ ∃ε > 0 ∀δ > 0 ∃x ∈ R (|x− a| < δ ∧ |f(x)− f(a)| ≥ ε) .

9