+ All Categories
Home > Documents > Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a...

Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a...

Date post: 20-May-2021
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
49
Introduction The first two parts of the course concern propositional logic. This is, roughly, the logic of combining statements. Here, the defining property of a statement is that it is either true or false. We’ll use statement and proposition interchangeably. So, for instance, ‘7 is a prime’ is a statement. So is ‘the moon is made of cheese’. But ‘is the moon made of cheese?’ and ‘add 8 and 7’ are not: the first is a question, the second an instruction. What about ‘x is prime’? This isn’t a statement, unless we also specify x, in a way that makes sense. (E.g. x =7, but perhaps not x = the moon.) In propositional logic, we will have propositional variables to represent statements, these might be called say p or q. We combine our propositional variables to form more complicated statements, called propositional terms. We combine them using connectives : ‘and’ (), ‘or’ (), ‘not’ (¬), ‘implies’ (), and ‘if and only if’ . When we do this at first it will be purely syntactic (that is, just formal manipulation of strings of symbols, with nothing to give meaning). When we do add meaning (using valuations ), the crucial thing to note is that the truth or falsity of a combined statement, say ‘7 is prime and the moon is made of cheese’ depends only on the truth or falsity of the two statements that are combined. It doesn’t depend in any way on what those two statements actually say. In the next section, we start making this all precise, with the definition of proposi- tional terms. 1. Propositional terms Definition 1.1. A propositional language is a nonempty set L of symbols, called propo- sitional variables, usually denoted p, r, q, . . . , p 1 ,p 2 ,.... We abbreviate propositional variable by p.v.. We define the set of propositional terms (or propositional formulas ) of L, which we write SL, by induction: S 0 L = L, S n+1 L = S n L ∪{(s t), (s t), (¬s), (s t), (s t): s, t S n L}. And then we define SL = S n0 S n L. We will always assume that L ∩ {∧, , , , ¬, (, )} = . Let’s consider the simplest case L = {p}. Then we have S 0 L = {p}. And S 1 L = {p, (p p), (p p), (p p), (p p), (¬p)}. And, for instance ((p p) (p p)) S 2 L. And so on. And for instance, with L = {p, q, r}, we have (p q), (¬r) S 1 L (among other things) and ((p q) (¬r)) S 2 L and so on. For the time being, this is completely formal. We will read (p q) as ‘p and q’, and so on, but so far we haven’t done anything to give these formal strings meaning. Note that the definition is inductive. And correspondingly, it is often helpful to prove results about terms by induction (which we call induction on complexity of terms). 1
Transcript
Page 1: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

Introduction

The first two parts of the course concern propositional logic. This is, roughly, thelogic of combining statements. Here, the defining property of a statement is that it iseither true or false. We’ll use statement and proposition interchangeably.

So, for instance, ‘7 is a prime’ is a statement. So is ‘the moon is made of cheese’.But ‘is the moon made of cheese?’ and ‘add 8 and 7’ are not: the first is a question,the second an instruction.

What about ‘x is prime’? This isn’t a statement, unless we also specify x, in a waythat makes sense. (E.g. x = 7, but perhaps not x = the moon.)

In propositional logic, we will have propositional variables to represent statements,these might be called say p or q. We combine our propositional variables to formmore complicated statements, called propositional terms. We combine them usingconnectives: ‘and’ (∧), ‘or’ (∨), ‘not’ (¬), ‘implies’ (→), and ‘if and only if’ ↔.

When we do this at first it will be purely syntactic (that is, just formal manipulationof strings of symbols, with nothing to give meaning). When we do add meaning (usingvaluations), the crucial thing to note is that the truth or falsity of a combined statement,say ‘7 is prime and the moon is made of cheese’ depends only on the truth or falsityof the two statements that are combined. It doesn’t depend in any way on what thosetwo statements actually say.

In the next section, we start making this all precise, with the definition of proposi-tional terms.

1. Propositional terms

Definition 1.1. A propositional language is a nonempty set L of symbols, called propo-sitional variables, usually denoted p, r, q, . . . , p1, p2, . . .. We abbreviate propositionalvariable by p.v.. We define the set of propositional terms (or propositional formulas)of L, which we write SL, by induction:

• S0L = L,

• Sn+1L = SnL ∪ {(s ∧ t), (s ∨ t), (¬s), (s→ t), (s↔ t) : s, t ∈ SnL}.

And then we define

• SL =⋃

n≥0 SnL.

We will always assume that L ∩ {∧,∨,→,↔,¬, (, )} = ∅.Let’s consider the simplest case L = {p}. Then we have S0L = {p}. And S1L =

{p, (p∧p), (p∨p), (p→ p), (p↔ p), (¬p)}. And, for instance ((p∧p)∧(p∧p)) ∈ S2L.And so on.

And for instance, with L = {p, q, r}, we have (p ∧ q), (¬r) ∈ S1L (among otherthings) and ((p ∧ q) ∨ (¬r)) ∈ S2L and so on.

For the time being, this is completely formal. We will read (p∧ q) as ‘p and q’, andso on, but so far we haven’t done anything to give these formal strings meaning.

Note that the definition is inductive. And correspondingly, it is often helpful to proveresults about terms by induction (which we call induction on complexity of terms).

1

Page 2: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

2

There are many brackets. This is to avoid any ambiguity (for instance how shouldwe read p∨ q ∧ r?). But there is still some possible ambiguity. In simple terms such as(p∧q) or ((p∧q)∨r) we can see which connective is introduced last. This is called theprincipal connective. And we have a clear sense of how these terms are built up frommore complicated terms. We can draw trees to represent this. For (p ∧ q) we have:

(p ∧ q)

qp

And for ((p ∧ q) ∨ r) we have:

((p ∧ q) ∨ r)

r(p ∧ q)

qp

For more complicated terms, it isn’t immediately clear that we can tell which con-nective is the principal connective. For instance, consider the term

(((¬p)→ ((p→ (¬q))→ (¬r)))→ (p→ r)).

How can we tell which is the principal connective? We can count brackets! So for theexample above we have:

(1(2(3¬p)2 → (3(4p→ (5¬q)4)3 → (4¬r)3)2)1→(p→ r))

(p→ r)

rp

(1(2¬p)1→((p→ (¬q))→ (¬r)))

(1(2p→ (3¬q)2)1→(¬r))

(¬r)

r

(p→ (¬q))

(¬q)

q

p

(¬p)

p

Here, we keep count of the number of open left brackets, until we get to the con-nective after we have one open bracket. This will be the principal connective (this willfall out of our proof below). In the tree, the principal connective is underlined.

Here is the example from class:

Page 3: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

3

(1(2(3(4¬p)3 ∧ q)2 ∧ (3(4¬r)3 ∨ (4r ∧ p)3)2)1∨((p ∧ r) ∨ (¬q)))

(1(2p ∧ r)1∨(¬q))

(¬q)

q

(p ∧ r)

rp

(1(2(3¬p)2 ∧ q)1∧((¬r) ∨ (r ∧ p)))

(1(2¬r)1∨(r ∧ p))

(r ∧ p)

pr

(¬r)

r

(1(2¬p)1∧q)

q(¬p)

p

We now prove that there is no ambiguity. (Note, for those who used truth tables in10101 or 10111, you’ve been implicitly assuming the following theorem!)

Theorem 1.2 (Unique readability). Let s ∈ SL. Then exactly one of the followingholds.

(a) s ∈ L (that is, s is a p.v.);(b) s is (¬t) for some t ∈ SL;(c) s is (t ∧ u) for some t, u ∈ SL;(d) s is (t ∨ u) for some t, u ∈ SL;(e) s is (t→ u) for some t, u ∈ SL;(f) s is (t↔ u) for some t, u ∈ SL.

Moreover, in (b), the term t is unique and in (c)-(f) both t and u are unique.

Proof. To begin, we prove that every term can be written in at least one of theseforms. We do this by induction on complexity of terms. First, note that, by definition,every term in S0L has one of the required forms (as they are all p.v’s). This gives thebase case of our induction. For the inductive step, suppose that n ≥ 0 and that everys ∈ SnL has one of the above forms. Let s ∈ Sn+1L. Then either s ∈ SnL, in whichcase we’re done by our inductive hypothesis, or s has one of the required forms by thedefinition of Sn+1L. This completes the induction and shows that every term is in oneof these forms.

The uniqueness step is more difficult. To prove it, we introduce some notation.Suppose that s ∈ SL. We let

l(s) = the number of left brackets ( in s,

andr(s) = the number of right brackets ) in s.

We need the following.

Lemma 1.3. Suppose that s ∈ SL. Then

l(s) = r(s).

Proof. This is again by induction on complexity. First suppose that s ∈ S0L. Then sis a p.v. and so l(s) = 0 and r(s) = 0. So the result holds in this case. Suppose thatn ≥ 0 and that for all s ∈ SnL we have l(s) = r(s). Suppose that s ∈ Sn+1L \ SnL.Then s has one of the forms (b)-(f).

If s is (¬t) for some t ∈ SnL, then l(s) = l(t) + 1 and r(s) = r(t) + 1. And by ourinductive hypothesis, l(t) = r(t), so we have l(s) = r(s).

Page 4: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

4

If s is (t ∧ u), for some t, u ∈ SnL then we have l(s) = l(t) + l(u) + 1 andr(s) = r(t) + r(u) + 1. And again by the inductive hypothesis, we have l(t) = r(t) andl(u) = r(u). So l(s) = r(s). And then there are similar cases for ∨,→ and ↔. �

Before continuing with the proof of the unique readability theorem, we need somefurther terminology. Every propositional term is a string of symbols, each of which iseither in L, or in {∧,∨,↔,→,¬} or ( or ). The terms have a certain particular form,and we refer to a general finite string of these symbols as a word. And if x, y, z arewords then xyz is the word obtained by first writing x then y and then z.

If a word x has the form yz then we say that y is a left subword of x, and we say yis a proper left subword of x if z is nonempty. Similarly, z is a right subword of x andis said to be proper if y is nonempty.

Lemma 1.4. Suppose that s is a propositional term and that x is a proper left subwordof s. Then either x is empty or

l(x) > r(x).

In particular, x is not a propositional term.

Proof. This is again by induction on the complexity of terms. Suppose that s ∈ S0L.Then s is a p.v. so if x is a proper left subword of s then x must be empty. So thelemma holds for all s in S0L.

Suppose that the lemma holds for all s ∈ SnL. Let s ∈ Sn+1L \ SnL. If s is (¬t)for some t ∈ SnL and x is a proper left subword of s then either x is empty, x is (, xis (¬, or x is (¬y, for a nonempty left subword y of t. We’re clearly done in the firstthree of these cases, so suppose that x is (¬y, with y a nonempty left subword of t.By 1.3 and the inductive hypothesis, we have

l(y) ≥ r(y).

So

l(x) = l(y) + 1

≥ r(y) + 1

> r(y)

= r(x)

as required.

Next suppose that s is (t∗u) where ∗ ∈ {∧,∨,→,↔} and t, u ∈ SnL. And supposethat x is a proper left subword of s. If x is empty we’re done, and if x is ( we’re done.Next suppose that x is (y where y is a nonempty left subword of t. By lemma 1.3 andthe inductive hypothesis, l(y) ≥ r(y). And so l(x) = l(y) + 1 > r(y) = r(x), andwe’re done. The same argument also works if x is (t∗.

Finally, suppose that x is (t ∗ y where y is a nonempty left subword of u. By lemma1.3 we have

l(t) = r(t).

And by 1.3 and the inductive hypothesis, we have

l(x) = 1 + l(t) + l(y)

> r(t) + r(y)

= r(x).

And this completes the proof of the lemma. �

Similarly, we have a statement for proper right subwords.

Page 5: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

5

Lemma 1.5. Suppose that s is a propositional term and that x is a proper right subwordof s. Then either x is empty or

r(x) > l(x).

In particular, x is not a propositional term.

The proof is very similar to the previous proof, so we omit it.

The following result completes the proof of the unique readbility theorem.

Proposition 1.6. Suppose that s ∈ SL. Then exactly one of the following holds: s isa p.v. or there is exactly one way of writing s as (¬t), with a unique t ∈ SL, or there isexactly one way of writing s as (t∗u) where t, u ∈ SL are unique and ∗ ∈ {∧,∨,↔,→}is unique.

Proof. We’re done if s is a p.v., so suppose it isn’t. If s has the form (¬t) for somet ∈ SL then s has (¬ as a left subword. If s has the form (t ∗ u) for some t, u ∈ SLthen s has either (p as a left subword, for some p.v. p, or (( as a left subword. Soonly one of these two cases can happen for a given s and we can treat the two casesseparately.

In the first case, it is clear that t is unique. So suppose that s is (t∗u) and is (t′∗′u′)for some t, u, t′, u′ ∈ SL and ∗, ∗′ ∈ {∧,∨ →,↔}. Suppose for a contradiction thatthese are not identical ways of writing s. As (t ∗ u) and (t′ ∗′ u′) are both s, we musthave that either t is a proper left subword of t′ or that t′ is a proper left subword oft (if t, t′ are identical, then we’re done). Suppose that the first of these happens (theother case is the same). As t is nonempty, we have

l(t) > r(t)

by lemma 1.4. But t ∈ SL so by lemma 1.3

l(t) = r(t).

This is a contradiction, and completes the proof of unique readability. �

Page 6: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

6

2. Valuations

Definition 2.1. Fix a propositional language L, and the corresponding propositionalterms SL. A valuation on the set of propositional terms is a function v : SL→ {T,F}such that for all terms s, t ∈ SL we have

(1) v(¬s) = T if and only if v(s) = F,(2) v(s ∧ t) = T if and only if v(s) = T and v(t) = T,(3) v(s ∨ t) = T if and only if v(s) = T or v(t) = T,(4) v(s→ t) = T if and only if v(s) = F or v(t) = T,(5) v(s↔ t) = T if and only if v(s) = v(t).

In fact, valuations are determined by the values that they take on the propositionalvariables. (This is another result you may have implicitly used in the past, for instancewhen computing truth tables.)

Proposition 2.2. Let L be a propositional language.

(i) If v0 : S0L→ {T,F} is any function then there is a unique valuation v : SL→{T,F} such that v(p) = v0(p) for all p ∈ S0L.

(ii) If t is any propositional term, and v, w are valuations agreeing on all the p.v.which occur in t then v(t) = w(t).

Proof. For (i), let v0 : S0L → {T,F} be any function. We prove, by induction on n,that there is a unique vn : SnL → {T,F} satisfying all the requirements of being avaluation for terms in SnL, such that for all p ∈ S0L we have

vn(p) = v0(p).

This is enough, as then we can define v : SL→ {T,F} by

v(t) = vn(t)

where t ∈ SnL. (This will be well-defined since if t ∈ SnL and t ∈ SmL, and withoutloss of generality n ≤ m, we have vn(t) = vm(t) by uniqueness.) This v will be avaluation and will satisfy v(p) = v0(p) for p ∈ S0L. It is easy to see that since eachvn is unique, the resulting v is also unique.

We now define the vn. For n = 0 there is nothing to do. So suppose that we’re givenvn. We need to define vn+1(s) for s ∈ Sn+1L. If s ∈ SnL then we put vn+1(s) = vn(s)so suppose that s ∈ Sn+1L \SnL. Then s is (¬t) for some t ∈ SnL or (t ∗u) for somet, u ∈ SnL and ∗ ∈ {∧,∨,→,↔}. If s is (¬t) then we put vn+1(s) = T if vn(t) = Fand vn+1(s) = F if vn(t) = T. If s is (t∨u) we put vn+1(s) = T if and only if v(t) = Tor v(u) = T. And similarly for the other connectives, we just use the rules of being avaluation. Because we have no choices to make, the resulting vn+1 is unique.

The second part is an exercise. First try proving the following, by induction oncomplexity of terms: if L′ ⊆ L are sets of p.v. then for every n we have SnL

′ ⊆ SnL.Then show that if v′ is a valuation on SL′ and v is a valuation on SL such thatv′(p) = v(p) for every p ∈ L′ then v′(t) = v(t) for every t ∈ SL′. From this, thesecond part follows easily. �

Example. Suppose that L = {p, q}. How many valuations are there on SL? To workthis out, note that by the proposition it suffices to count functions L→ {T,F}. As Lhas two elements, there are four such functions and so four valuations.

Definition 2.3. A propositional term t is a tautology if v(t) = T for every valuationv. On the other hand t is unsatisfiable if v(t) = F for every valuation v.

Page 7: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

7

The idea here is that a tautology is a term that is true ‘in all possible worlds’.

Truth tables are a convenient way of summarizing the effect of valuations on a propo-sitional term. Suppose that t is a term in which only propositional variables p1, . . . , pnoccur. Then the truth table for t will be of the form

p1 p2 · · · pn tT T · · · T ?T T · · · F ?...

...... ?

F F · · · F ?

When computing the truth table for a given term t, it is helpful to record the effectof the valuations on the terms that occur in the construction of t. It is also very helpfulto be systematic.

For a first example, let’s compute the truth table of the term (p→ (q → p)):

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

So v(p→ (q top)) = T for every valuation v, and hence (p→ (q → p)) is a tautology.

For another example, suppose we want to compute the truth table of ((¬(p∨ q))→(p ∧ q)). Following the advice given above, we find the following.

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

Notice that the third column and the final column of this truth table are identical.That is, the terms (p ∨ q) and ((¬(p ∨ q))→ (p ∧ q)) are true under exactly the samevaluations. When this happens, we say that the terms are logically equivalent.

For a more complicated example, we compute the truth table of the term t given by

((p→ (q ∧ r))↔ (¬(p ∨ r))).

Here it is.

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

Here is the formal definition of logical equivalence.

Page 8: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

8

Definition 2.4. Two propositional terms s, t are said to be logically equivalent ifv(s) = v(t) for every valuation v. We write s ≡ t to indicate that s and t arelogically equivalent.

For example p ≡ p ∧ p.

Proposition 2.5. Let s, t be propositional terms. Then s ≡ t if and only if (s↔ t) isa tautology.

Proof. Suppose s ≡ t. If v is any valuation, then v(s) = v(t) since s ≡ t. And thenv(s ↔ t) = T, by the definition of valuations. But v was arbitrary, so (s ↔ t) is atautology.

On the other hand, if (s ↔ t) is a tautology, and v is any valuation, then we havev(s ↔ t) = T. By the definition of valuations, v(s) = v(t). And as v was arbitrary,s ≡ t. �

Definition 2.6. Let S be a set of propositional terms and t a propositional term. Wewrite S |= t and say that t is a logical consequence of S (or that S logically implies t,or even just t follows from S) if, for every valuation v such that v(s) = T for all s ∈ S,we have v(t) = T. (Informally, t follows from S if whenever S is true t is true.)

For example, let us show that {(p → q), (¬q)} |= (¬p). We can do this using atruth table (though it can be done by other means too).

p q p→ q ¬q ¬pT T T F FT F F T FF T T F TF F T T tr

We see that whenever v is a valuation such that v(p→ q) = T and v(¬p) = T we havev(¬p) = T (the bottom row is the only relevant valuation). Hence {(p→ q), (¬q)} |=(¬p).

For another example, what does ∅ |= t mean? (Recall that ∅ denotes the emptyset.) Well, in this case, any valuation at all makes ∅ true, as there are no terms tomake true. So ∅ |= t holds if every valuation makes t true, that is, if t is a tautology.

Definition 2.7. Let S be a set of propositional terms. We write v(S) = T if v(s) = Tfor all s ∈ S. We say that S is tautologous if v(S) = T for every valuation v. And wesay that S is satisfiable if v(S) = T for some valuation v. Finally, S is unsatisfiable iffor every valuation v there is some s ∈ S such that v(s) = F, i.e. there is no v suchthat v(S) = T.

We also need some notation. We will abbreviate expressions such as S∪{t1, . . . , tn} |=u by S, t1, . . . , tn |= u.

Proposition 2.8. Let S ⊆ SL and t, t′, u ∈ SL. Then

(i) S |= t if and only if S ∪ {¬t} is unsatisfiable;(ii) S, t |= u if and only if S |= (t→ u);(iii) S, t, t′ |= u if and only if S, (t ∧ t′) |= u.

Proof. (i) We have: S ∪ {¬t} is unsatisfiable if and only if for all valuations v wehave v(s) = F for some s ∈ S or v(¬t) = F. This holds if and only if for allvaluations v, if v(s) = T for all s ∈ S then v(¬t) = F, which is equivalent tofor all valuations v, if v(s) = T for all s ∈ S then v(t) = T, and this is thedefinition of S |= t.

Page 9: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

9

(ii) S, t |= u if and only if for all valuations v, if v(S) = T and v(t) = T thenv(u) = T. This holds if and only if for all valuations v with v(S) = T we havev(t→ u) = T, which is the definition of S |= (t→ u).

(iii) S, t ∧ t′ |= u if and only if for all valuations v if v(S) = T and v(t ∧ t′) = Tthen v(u) = T. This holds if and only if for all valuations v if v(S) = T andv(t) = T and v(t′) = T then v(u) = T, which is the definition of S, t, t′ |= u.

It can often be quicker to reason directly with valuations than to use truth tables.Above, we showed using a truth table that (p → q), (¬q) |= (¬p). We now do thisagain, arguing directly using valuations. So suppose that v(p→ q) = T and v(¬q) = T.Then (v(p) = F or v(q) = T) and v(¬q) = T. So v(p) = F and so v(¬p) = T.

Before the next section we do some more examples of reasoning with valuations.First, from the 2018 paper, is the following statement true for all propositional term sand t?

If s ∧ t |= ¬t and s ∧ ¬t |= t then s is unsatisfiable.

To see whether this is true, we try to prove it and see if we get stuck. Suppose,in the hope of finding a contradiction, that s ∧ t |= ¬t and s ∧ ¬t |= t and that s issatisfiable . Then there is a valuation v such that v(s) = T. We have either v(t) = Tor v(t) = F. If v(t) = T then since s∧t |= ¬t and we have v(¬t) = T so that v(t) = F,a contradiction. So we must have v(t) = F. But then v(¬t) = T and since s ∧ ¬t |= twe have v(t) = T, another contradiction. So our original assumption that v(s) = T iswrong, and there is no such v, so s is indeed unsatisfiable. So the statement is true.

Next consider the following.

If s ∧ t |= ¬t and s ∧ ¬t |= ¬t then s is unsatisfiable.

We start as before, and assume that this hypothesis holds and that s is satisfiable. Sov(s) = T for some valuation v. As before we get a contradiction if v(t) = T. Nowthough there is no obvious contradiction when v(t) = F. This suggests looking fora counterexample. Trying simple terms is a good idea. So let s be p a propositionalvariable. We know that if v(s) = T then we can’t have v(t) = T (if our assumptionsare to hold) so let’s try taking t to be ¬p. Then we do have s ∧ t |= ¬t. And clearlywe have s ∧ ¬t |= ¬t. But s is satisfiable. So the statement is false, and taking s as ap.v. p and t as ¬p gives a counterexample.

Notation. In order to keep the notion under control, we now drop some of the brackets.We omit:

• The (·) associated to (¬p) for p ∈ L.• The (·) associated to the principal connective.

So for example we now write (¬p ∧ q) → (¬r ∨ ¬p) in place of (((¬p) ∧ q) →((¬r) ∨ (¬q))).

Here are some more examples:

(1) (¬p ∧ q)→ (p ∧ ¬q) is really

(((¬p) ∧ q)→ (p ∧ (¬q)))(2) (¬(¬p ∧ q))→ (¬r ∨ q) is really

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

Page 10: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

10

3. Normal forms

Recall that we say that terms s, t ∈ SL are logically equivalent if, for all valuationsv we have v(s) = v(t).

Lemma 3.1. Suppose that s, t ∈ SL. The following are equivalent.

(i) s ≡ t,(ii) s |= t and t |= s,(iii) ∅ |= s↔ t,(iv) s↔ t is a tautology.

We’ve proved these already. But if you’re at all unsure, it is worth having a go atdoing them yourself as an exercise.

The relation ≡ has the following properties:

(1) ≡ is reflexive, that is s ≡ s for all s ∈ SL,(2) ≡ is symmetric, that is, if s ≡ t then t ≡ s,(3) ≡ is transitive, that is, if s ≡ t and t ≡ u then s ≡ u.

This means that logical equivalence is an equivalence relation and so SL can bepartitioned into equivalence classes. So we can write SL = E1 ∪ E2 ∪ · · · , with apossibly infinite union, where for each i we have s, t ∈ Ei if and only if s ≡ t, and fori 6= j we have Ei ∩ Ej = ∅.

Note that it makes sense to talk about the value of a valuation on one of theseequivalence classes.

For example suppose that L = {p}, a language with exactly one propositional vari-able. Since two terms are logically equivalent if and only if they have the same columnin their truth tables, finding all the logical equivalence classes of SL is the same asfinding the possible truth tables. For our L the possible truth tables are given by thecolumns t1, . . . , t4 below.

p t1 t2 t3 t4T T T F FF T F T F

We can find terms in SL with these columns, for instance p ∨ ¬p, p,¬p, and p ∧¬p respectively. So there are exactly four equivalence classes, and these terms arerepresentatives of these four equivalence classes.

Here are some basic logical equivalences, where s, t, u ∈ SL.

• s ∧ t ≡ t ∧ s.• s ∨ t ≡ t ∨ s,• ¬(s ∨ t) ≡ (¬s ∧ ¬t),• ¬(s ∧ t) ≡ ¬s ∨ ¬t,• ¬¬s ≡ s,• s→ t ≡ ¬s ∨ t,• (s ∧ t) ∧ u ≡ s ∧ (t ∧ u) (so we can unambiguously write s ∧ t ∧ u),• (s ∨ t) ∨ u ≡ s ∨ (t ∨ u) (so we can unambiguously write s ∨ t ∨ u),• (s ∧ t) ∨ u ≡ (s ∨ u) ∧ (t ∨ u),• (s ∨ t) ∧ u ≡ (s ∧ u) ∨ (t ∧ u),• s ∧ s ≡ s ∨ s ≡ s,• (s ∧ t) ∨ (¬s ∧ t) ≡ t.• (s ∧ t) ∨ s ≡ s.

Page 11: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

11

These can all be checked directly by arguing with valuations. We just do the last one.If v(s) = T then clearly v((s ∧ t) ∨ s) = T. So suppose that v((s ∧ t) ∨ s) = T. Theneither v(s) = T, and we’re done, or v(s ∧ t) = T, so that v(s) = T and we’re done.

The following proposition says that we can ‘substitute in’ logically equivalent termswithout changing the logical equivalence class.

Proposition 3.2. Suppose that s, s′, t, t′ ∈ SL and that s ≡ s′ and t ≡ t′. Then

(1) ¬s ≡ ¬s′,(2) s ∧ t ≡ s′ ∧ t′,(3) s ∨ t ≡ s′ ∨ t′,(4) s→ t ≡ s′ → t′.

Proof. We prove the last one (the others are left to you). Suppose v is a valuation. Wehave v(s→ t) = F if and only if v(s) = T and v(t) = F. Since s ≡ s′ and t ≡ t′, thisholds if and only if v(s′) = T and v(t′) = F. And this is equivalent to v(s′ → t′) = F.So s→ t ≡ s′ → t′. �

We introduce some notation, which we will use a fair bit. We define∧n

i=1 and∨n

i=1

by induction on n, as follows.∧1

i=1 si = s1 and

k+1∧i=1

si =

(k∧

i=1

si

)∧ sk+1

and∨1

i=1 si = s1 andk+1∨i=1

si =

(k∨

i=1

si

)∨ sk+1.

These behave exactly as we might expect.

Proposition 3.3. Suppose that s1, . . . , sn ∈ SL and that v is a valuation. Then

(1) v (∧n

i=1 si) = T if and only if v(si) = T for all i = 1, . . . , n,(2) v (

∨ni=1 si) = T if and only if v(si) = T for some i = 1, . . . , n,

(3)∧n

i=1 si ≡ ¬∨n

i=1 ¬si,(4)

∨ni=1 si ≡ ¬

∧ni=1 ¬si.

Proof. (1) By induction on n. The case n = 1 is trivial, so suppose that v (∧n

i=1 si) =T if and only if v(si) = T for all i = 1, . . . , n. By the definition of

∧we

have v(∧n+1

i=1 si

)= v (

∧ni=1 si ∧ sn+1). So v

(∧n+1i=1 si

)= T if and only

if v (∧n

i=1 si ∧ sn+1) = T. This holds if and only if v (∧n

i=1 si) = T andv(sn+1) = T, by the definition of valuations. And this holds if and onlyv(si) = T for i = 1, . . . , n and v(sn+1) = T, by the induction hypothesis. Andthat is what we wanted.

(2) Very similar to the previous one.(3) For any valuation v we have v (

∧ni=1 si) = T if and only if v(si) = T for

i = 1 . . . , n, by (1)if and only if v(¬si) = F for i = 1, . . . , nif and only if v (

∨ni=1 ¬si) = F by (2)

if and only if v (¬∨n

i=1 ¬si) = T.(4) Similar to the previous one,

From this, we can easily conclude the following.

Page 12: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

12

Corollary 3.4. Suppose that s1, . . . , sn, t1, . . . , tm ∈ SL are such that {s1, . . . , sn} ={t1, . . . , tm} (think about what this means). Then

n∨i=1

si ≡m∨j=1

tj

andn∧

i=1

si ≡m∧j=1

tj .

Definition 3.5. (1) We call any p.v. p or negation ¬p of a p.v. a literal.(2) A term t is in disjunctive normal form (which we abbreviate dnf) if it has the

formn∨

i=1

mi∧j=1

gi,j

where each gi,j is a literal.

Theorem 3.6 (The disjunctive normal form theorem.). Suppose that t is a propositionalterm. Then there is a propositional term s in dnf such that

t ≡ s.Moreover, if {p1, . . . , pk} are the p.v. occurring in t then we may take s to have theform

n∨i=1

mi∧j=1

gi,j

where n ≤ 2k,mi ≤ k.

Proof. Let v1, . . . , vn be all the valuations v on SL, where L = {p1, . . . , pk}, such thatv(t) = T. We can assume that n ≥ 1, for if not then t is unsatisfiable, and logicallyequivalent to p ∧ ¬p, which is in disjunctive normal form. For each i = 1, . . . , n andj = 1, . . . , k let

gi,j =

{pj if vi(pj) = T¬pj if vi(pj) = F.

Then for any valuation v, we have v(∧k

j=1 gi,j

)= T if and only if v = vi. Now let s

be the termn∨

i=1

k∧j=1

gi,j .

Then if v is any valuation on SL, we have v(s) = T if and only if v(∧k

j=1 gi,j

)= T

for some i, and this holds if and only if v = vi for some i, which holds if and only ifv(t) = T.

So s ≡ t, as we wanted. Finally, we evidentally have mi ≤ k (as in the term we’vefound they are in fact all equal to k), and n ≤ 2k since there are only 2k valuations onSL. �

The proof of the dnf theorem gives us a method to find a dnf for a term t: first wefind all valuations v such that v(t) = T then we take conjunctions of literals as in theproof of the theorem. Our dnf is given by taking disjunctions of these.

For example, consider the term t given by (p→ (q∧r))∧(p∨r). To use this methodto find a dnf for t, we first compute all the valuations v on p, q, r such that v(t) = T.To do this, we can use a truth table.

Page 13: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

13

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

Now for each valuation v such that v(t) = T, we write down the correspondingconjunction of literals. So, for the first row, we take p∧ q∧ r, for the fifth row, we take¬p∧ q∧ r and for the seventh row we take ¬p∧¬q∧ r. Our dnf is then the disjunctionof all of these, that is, our dnf for t is

(p ∧ q ∧ r) ∨ (¬p ∧ q ∧ r) ∨ (¬p ∧ ¬q ∧ r).An alternative way to compute a dnf for t is to directly manipulate the term using thevarious logical equivalences. We have:

t ≡ (p→ (q ∧ r)) ∧ (p ∨ r)≡ (¬p ∨ (q ∧ r)) ∧ (p ∨ r) use s→ t ≡ ¬s ∨ t≡ (¬p ∧ (p ∨ r)) ∨ ((q ∧ r) ∧ (p ∨ r)) use (s ∨ t) ∧ u ≡ (s ∧ u) ∨ (t ∧ u)

≡ (¬p ∧ p) ∨ (¬p ∧ r) ∨ (q ∧ r ∧ p) ∨ (q ∧ r ∧ r) and again

≡ (¬p ∧ r) ∨ (q ∧ r ∧ p) ∨ (q ∧ r ∧ r) use (p ∧ ¬p) ∨ t ≡ t≡ (¬p ∧ r) ∨ (q ∧ r ∧ p) ∨ (q ∧ r) use (t ∧ t ≡ t≡ (¬p ∧ r) ∨ (q ∧ r) use (t ∧ s) ∨ s ≡ s

We can also go directly from the dnf we found using the truth table to this one, asfollows:

t ≡(p ∧ q ∧ r) ∨ (¬p ∧ q ∧ r) ∨ (¬p ∧ ¬q ∧ r) from the truth table

≡ (p ∧ q ∧ r) ∨ (¬p ∧ r) using (s ∧ t) ∨ (¬s ∧ t) ≡ t≡ (q ∧ r) ∨ (¬p ∧ r) using (s ∧ t ∧ u) ∨ (¬s ∧ t) ≡ (t ∧ u) ∨ (¬s ∧ t).

We’ve now found lots of different dnfs for t. In particular, normal forms are not unique!

For another example, suppose that t is the term (p ∧ q)→ (¬p ∨ r). Again we firstcompute the truth table for t.

p q r p ∧ q ¬p ¬p ∨ r tT T T T F T TT T F T F F FT F T F F T TT F F F F F TF T T F T T TF T F F T T TF F T F T T TF F F F T T T

From the truth table, we see that only one valuation v makes t false, namely thevaluation determined by v(p) = T, v(q) = T and v(r) = F. So for each other valuation,we write down a conjunction of literals as in the proof of the theorem. For instance, forthe valuation determined by v(p) = v(q) = v(q) = T we take the conjunction p∧ q∧ r.

Page 14: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

14

And for v determined by v(p) = v(r) = T and v(q) = F we take p∧¬q∧ r. Doing thisfor each of the seven valuations involved, and taking disjunctions we the following dnffor t:

(p∧q∧r)∨(p∧¬q∧r)∨(p∧¬q∧¬r)∨(¬p∧q∧r)∨(¬p∧q∧¬r)∨(¬p∧¬q∧r)∨(¬p∧¬q∧¬r).We can simplify this a lot. First, using the rule (s ∧ t) ∨ (¬s ∧ t) ≡ t three times, onthe last four terms, t is equivalent to

(p ∧ q ∧ r) ∨ (p ∧ ¬q ∧ r) ∨ (p ∧ ¬q ∧ ¬r) ∨ ¬p.Using the same rule on the second and third terms, this is equivalent to

(p ∧ q ∧ r) ∨ (p ∧ ¬q) ∨ ¬p.Then using s ∨ (¬s ∧ t) ≡ s ∨ t (on the second and third terms), this is equivalent to

(p ∧ q ∧ r) ∨ ¬q ∨ ¬pand a similar argument shows that this is equivalent to

r ∨ ¬q ∨ ¬p.Another way to see this, directly from the truth table, is to note, using the truth table,that

¬t ≡ p ∧ q ∧ ¬r.So

¬¬t ≡ ¬(p ∧ q ∧ ¬r).Then this is equivalent to

¬p ∨ ¬q ∨ r.

Similar ideas will be used in proving the next result.

Definition 3.7. A term s is in conjunctive normal form (cnf) if s has the formn∧

i=1

mi∨j=1

gi,j

where each gi,j is a literal.

Theorem 3.8. Suppose that t is a propositional term. Then there is a propositionalterm s in cnf such that s ≡ t. If {p1, . . . , pk} are the pv occurring in t then we cantake s in cnf (as in the defn) with n ≤ 2k and mi ≤ k.

Proof. This follows from the dnf theorem. By that theorem, there is a dnf for ¬t, sowe can write:

¬t ≡n∨

i=1

mi∧j=1

gi,j

with literals gi,j . Now,

t 𠪪t

≡ ¬

n∨i=1

mi∧j=1

gi,j

.

Using the various equivalences listed at the start of this section, we see that this isequivalent to

n∧i=1

mi∨j=1

¬gi,j .

And each ¬gi,j is either a literal, or we can cancel a ¬¬ to make is a literal. So we’redone. �

Page 15: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

15

As with the dnf Theorem, the proof of the cnf Theorem gives us a method to findcnfs. For instance, suppose that t is the term

(p ∧ q)→ (¬p ∨ r).Following the proof of the cnf theorem, we first find a dnf for ¬t. We do this by directmanipulation using logical equivalences, but it could also be done using a truth table.We have

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

So¬t ≡ p ∧ q ∧ ¬r.

Now again following the proof of cnf, we negate both sides of this:

¬¬t ≡ ¬(p ∧ q ∧ ¬r)≡ ¬p ∨ ¬q ∨ ¬¬r≡ ¬p ∨ ¬qr

and we have found a cnf for t.

Finally, we find a cnf for the term t given by (p → (q ∧ r)) ∧ (p ∨ r) (which weconsidered in the examples of dnfs. ) First we find a dnf for ¬t:

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

This is a dnf, so

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

which is in cnf. Alternatively, we could use the truth table for t (see earlier) to computea dnf for ¬t, and then get the following cnf for t:

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

Page 16: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

16

4. Adequate sets of connectives

The proof of the dnf theorem shows more than might appear to be the case. LetL = {p1, . . . , pk}. Let V alp1,...,pk

be the set of all valuations on L. We can think of atruth table as a function V alp1,...,pk

→ {T,F}. We can also associate such a functionto a term t ∈ SL via v 7→ v(t). The proof of the dnf theorem shows that all functionsV alp1,...,pk

→ {T,F} can be obtained as the functions induced by terms.

We can also ask what happens if we have fewer connectives, or perhaps new con-nectives. Can we still represent all functions V alp1,...,pk

→ {T,F}?

Definition 4.1. We say that a set S of propositional connectives is adequate if, forevery propositional term t (in any number of propositional variables), there is a termt′, constructed only using the connectives in S, which is logically equivalent to t.

Here, by logically equivalent we mean: defines the same function V alp1,...,pk→

{T,F} (with p1, . . . , pk the pv that occur in t). Informally, we think of this as meaning‘has the same truth table’.

Note that we will use connectives differing from those we’ve already met. To proceedproperly we should define the set of terms for these new connectives, prove uniquereadability and so on. We won’t do this, but it is important to know that it could bedone!

Here are some examples.

(1) The set {∧,∨,¬} is adequate. This follows immediately from the dnf theorem.(2) The set {∧,¬} is adequate. We can use s ∨ t ≡ ¬(¬s ∧ ¬t) to eliminate each

occurrence of ∨ from a dnf for a given term, and thus find a logically equivalentterm in which only ¬ and ∧ occur.

(3) Similarly, the set {∨,¬} is adequate.(4) Next we introduce a new connective. We define the binary connective | by:

p q p|qT T FT F TF T TF F T

This is called NAND, or the Sheffer stroke. To show that {|} is adequate, weshow that we can represent ∧ and ¬. This is enough, as we already know that{∧,¬} is adequate. First, note that the term p|p is equivalent to ¬p:

p p|pT FF T.

But from the truth table for |, we can see that p|q ≡ ¬(p ∧ q). So

p ∧ q ≡ ¬(p|q) ≡ (p|q)|(p|q),

and the latter terms uses only |. So {|} represents both ∧ and ¬, and so is adequate.

Proving that a set of connectives is not adequate is more difficult. The idea is toexperiment, and try to spot a pattern. Then prove that this pattern does indeed hold,by induction on complexity of terms. Then take a term that doesn’t obey this pattern,and so can’t be obtained from the set of connectives in question. Hopefully an examplewill help. Suppose that we take S = {∧,∨}. Experimenting with terms formed usingonly these connectives, we might get the feeling that these connectives are positive insome way. And in fact, we can’t represent negation using these connectives.

Page 17: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

17

To show this, we first show that if t is a term using only {∧,∨} and v is the valuationgiving all propositional variables the value T, then v(t) = T. This is ‘the pattern’, andwe prove it by induction on complexity. In the base case, t is a propositional variableand there isn’t anything to do. Inductively, suppose that t is either s ∧ u or s ∨ u,and v(s) = v(u) = T, where v is the valuation giving all propositional variables thevalue T. Then, by the definition of valuation, v(t) = T, and that completes the proofby induction. Now we take a term not fitting this pattern, let’s take ¬p. If v(p) = Tthen v(¬p) = F, hence by the pattern, ¬p can’t be represented using only ∧ and ∨, so{∧,∨} is not adequate.

Page 18: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

18

5. Interpolation

Given that

¬((p1 ∧ p2)→ p3) |= p4 → p1

we might wonder whether there is a term t in which only p1 occurs such that

¬((p1 ∧ p2)→ p3) |= t

and

t |= p4 → p1.

Such a term is called an interpolant, and the interpolation theorem tells us that theseexist, apart from in trivial cases.

In our particular example, it is easy to see that we can take t to be p1.

Theorem 5.1 (The interpolation theorem). Let L1, L2 be propositional languages.Suppose that s ∈ SL1 and t ∈ SL2 and that s |= t. Then either s is unsatisfiable, or tis a tautology, or there is a u ∈ SL3, where L3 = L1 ∩L2, such that s |= u and u |= t.

Proof. We suppose that s is not unsatisfiable, and that t is not a tautology, and thats |= t, and find a u as in the conclusion. Let v1 be a valuation on SL1 such thatv1(s) = T and let v2 be a valuation on SL2 such that v2(t) = F. Suppose, for acontradiction, that L3 = L1 ∩ L2 is empty. Then we can define a valuation v onS(L1 ∪ L2) by

v(p) =

{v1(p) if p ∈ L1

v2(p) if p ∈ L2.

Then we would have v(s) = v1(s) = T and v(t) = v2(t) = F. But we have assumedthat s |= t so there is no valuation w such that w(s) = T and w(t) = F, and we havea contradiction. So L3 6= ∅.

By the dnf theorem, we can find a term in dnf which is logically equivalent to s, say

n∨i=1

li∧j=1

gi,j ∧mi∧k=1

hi,k

where gi,j ∈ SL1 \ SL3 and hi,k ∈ SL3 are literals.

Without loss of generality, none of the disjuncts are unsatisfiable (any that are canbe removed, and nothing changes). Let u be the term

n∨i=1

mi∧k=1

hi,k.

Then u ∈ SL3. Let v be a valuation on SL1 such that v(s) = T. Then for some

i we have v(∧li

j=1 gi,j ∧∧mi

k=1 hi,k

)= T. So v (

∧mi

k=1 hi,k) = T for some i, and so

v(u) = T. Hence s |= u.

Now we show that u |= t. Suppose that v is a valuation on SL2 such that v(u) = T.By definition of u, we have some i0 such that v

(∧mi0

k=1 hi0,k)

= T. Define a valuationw on L1 ∪ L2 by

w(p) =

v(p) if p ∈ L2

T if p is gi0,j for some j

F if ¬p is gi0,j for some j

T if p ∈ L1 \ L2 and p doesn’t occur in the i0th disjunct.

Page 19: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

19

Then

w

li0∧j=1

gi0,j ∧mi0∧k=1

hi0,k

= T.

So w(s) = T, and hence w(t) = T. But w agrees with v on all terms in SL2, sov(t) = T, and u |= t. �

Again the proof gives a method for finding interpolants. First we find a dnf for theleft hand side, then we remove literals that are not in L3.

For instance, given L = {p, q, r, s} and told that

((p ∨ q)→) ∧ (r → p) |= s→ (p ∨ ¬q)we can try to find an interpolant involving only p, q. (In the setting of the theorem,L1 = {p, q, r}, L2 = {p, q, s} so L3 = {p, q} and it is easy to check that we are notin the trivial cases. Following the proof of the theorem, we first find a dnf for the lefthand side (any method for finding this is fine!). We have

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

Now that we’ve found the dnf, the proof of interpolation tells us to just remove theliterals involving r. So we get

p ∨ (¬p ∧ ¬q)as an interpolant. (Note that this is equivalent to p∨¬q, so this latter term also works.Interpolants, like dnfs, are not unique.)

For a second example, suppose that we know

(p1 → (¬p2 ∧ p3)) ∧ (p1 ∨ (p2 ∧ ¬p3)) |= ((p3 → p2)→ p4) ∨ (¬p4 → (p2 ∧ ¬p3)).

Then we can find an interpolant involving only p2 and p3. We first find a dnf for theleft hand side. We could do this using truth tables, but instead we compute directly.We have

(p1 → (¬p2 ∧ p3)) ∧ (p1 ∨ (p2 ∧ ¬p3)) ≡ (¬p1 ∨ (¬p2 ∧ p3)) ∧ (p1 ∨ (p2 ∧ ¬p3))

≡ ((¬p1 ∨ (¬p2 ∧ p3)) ∧ p1) ∨ ((¬p1 ∨ (¬p2 ∧ p3)) ∧ (p2 ∧ ¬p3))

≡ (¬p1 ∧ p1) ∨ (¬p2 ∧ p3 ∧ p1) ∨ (¬p1 ∧ p2 ∧ ¬p3) ∨ (¬p2 ∧ p3 ∧ p2 ∧ ¬p3)

≡ (¬p2 ∧ p3 ∧ p1) ∨ (¬p1 ∧ p2 ∧ ¬p3)

To get our interpolant, we remove the literals not in L3, so not involving p2 or p3, andwe get

(¬p2 ∧ p3) ∨ (p2 ∧ ¬p3).

Page 20: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

20

6. Deductive systems

In the first part of the course, we have introduced (among other things) a notion of‘follows’ S |= t. This was semantic, that is involving valuations (so assigning meaning).In this section, we will introduce a purely syntactic notion S ` t. We will do this usinga formal system (or calculus) for deductions (i.e. formal proofs) . This can be thoughtof as a kind of toy model of real proofs. We will prove two theorems, the SoundnessTheorem (easy) and the Completeness Theorem (hard!) which show that the semanticand syntactic notions coincide.

The idea of a formal calculus for deductions is that a term t is derivable from a setof terms S (perhaps empty) if there is a sequence of ‘proof steps’, each of which hasone of the following forms:

(1) we use an axiom, one of a list of terms we agree are always allowed;(2) we state an assumption from our set S;(3) we use a rule of inference on some of the earlier steps.

There are many possible choices for setting this up. Our system is a ‘Hilbert-style’system, with lots of axioms and few rules.

We first describe the axioms.

Definition 6.1. The axiom schemas of our calculus are all propositional terms of oneof the following forms:

(i) s→ (t→ s)(ii) (r → (s→ t))→ ((r → s)→ (r → t))(iii) ¬¬s→ s(iv) (¬s→ ¬t)→ (t→ s)

where r, s, t are any propositional terms (in the propositional variables of our language).An axiom is an instance of an axiom scheme.

For instance, the term

(p ∧ q)→ ((¬p ∧ q)→ (p ∧ q)))

is an axiom, an instance of the first schema, with s equal to p∧q and t equal to ¬p∧q.

The term

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

is an axiom, an instance of the second axiom scheme. (With r the term p ∨ q, and sequal to ((p ∧ q)→ r) and t the term (r ∧ ¬q))

Finally, for instance

¬¬(p ∨ p ∨ q)→ (p ∨ p ∨ q)is an instance of the third scheme.

Definition 6.2. A deduction is a finite sequence S ` t1, . . . , S ` tn, where S ⊆ SLand t1, . . . , tn ∈ SL are such that for each i = 1, . . . , n one of the following holds:

(1) ti is an axiom,(2) ti ∈ S,(3) there are j, k < i such that tj is tk → ti.

We will write S ` t if there is a deduction S ` t1, . . . , S ` tn, where t is tn. We readS ` t as ‘S proves t’.

Page 21: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

21

When we give deductions we label them, to explain why they are deductions. Wenumber each line, and write abbreviations to the side to indicate the justification foreach line. We write LA followed by (i),(ii), (iii) or (iv), to indicate that we’ve useda logical axiom. We write NLA to indicate that we’ve used a non-logical axiom (sosomething from the set S), and we write MPj,k to indicate that we’ve used modusponens (the third on the list) with lines j and k.

For instance, the following is a deduction. (Here S is the empty set.)

(1) ` p→ ((p→ p)→ p) LA(i)(2) ` (p→ ((p→ p)→ p))→ ((p→ (p→ p))→ (p→ p)) LA(ii)(3) ` (p→ (p→ p))→ (p→ p) MP1,2(4) ` p→ (p→ p) LA(i)(5) ` p→ p MP3,4

Here is a second example of a deduction, this time with S = {p→ q, q → r}.

(1) S ` q → r NLA(2) S ` (q → r)→ (p→ (q → r)) LA(i)(3) S ` (p→ (q → r)) MP1,2(4) S ` (p→ (q → r))→ ((p→ q)→ (p→ r)) LA(ii)(5) S ` (p→ q)→ (p→ r) MP3,4(6) S ` p→ q NLA(7) S ` p→ r MP5,6

Note that it can be very difficult to find deductions in this calculus.I don’t expect youto be able to find deductions, but I do expect you to be able to label correct deductions.

Lemma 6.3. Suppose that T is a set of propositional terms, S ⊆ T and that t is apropositional term such that S ` t. Then T ` t.

Proof. By assumption, we have a deduction S ` t1, . . . , S ` tn, where tn is t. It followsthat T ` t1, . . . , T ` tn is also a deduction, since S ⊆ T . So T ` t. �

We now move on to the easier of two theorems explaining the relationship betweenS ` t and S |= t.

Theorem 6.4 (The soundness theorem). Suppose that S is a set of propositional termsand that t is a propositional term. If S ` t then S |= t.

Note the special case that S = ∅. Before we prove the soundness theorem, we provea special case of that special case:

Lemma 6.5. Suppose that u is a logical axiom. Then u is a tautology.

Proof. We have four cases, corresponding to the four axiom schemas. We do the mostinvolved case. (We’ve done the second and fourth in tutorials, the first in lectures andthe third is easy. Here we redo the second.) Suppose that u is

(r → (s→ t))→ ((r → s)→ (r → t))

where r, s, t are propositional terms. For a contradiction suppose that u is not atautology. Then there is a valuation, v say, such that v(u) = F. Then v((r → s) →(r → t)) = F so v(r → s) = T and v(r → t) = F. From the latter, v(r) = T andv(t) = F. So v(s) = T. But then v(r → (s→ t)) = F, and v(u) = T, a contradiction.So u is indeed a tautology.

Page 22: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

22

Proof of the Soundness Theorem. Suppose that S ` t, and that v is a valuation suchthat v(S) = T. We need to prove that v(t) = T, so that we can conclude S |= t. Byour assumption, we have a deduction S ` t1, . . . , S ` tn, where tn is t. We will proveby induction on i that v(ti) = T.

First, suppose that i = 1. The first line of our deduction, S ` t1, must be either alogical axiom or a nonlogical axiom. In the first case, by lemma 6.5, t1 is a tautology,so we’re done. In the second case t1 ∈ S, so we’re done.

For the inductive step, suppose that v(tj) = T for all j < i. If the ith step is alogical axiom or a nonlogical axiom, we can proceed as above. So suppose that the ithstep is an application of modus ponens. Then there are j, k < i such that tj is tk → ti.Inductively, we have v(tk) = T and v(tk → ti) = T. It then follows that v(ti) = T.This completes the inductive step, and so the proof of the Soundness Theorem.

Page 23: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

23

7. The deduction theorem

Before proving the completeness theorem, we prove a result which is useful forconstructing deductions.

We will need a lemma.

Lemma 7.1. For any set S of propositional terms and any term s we have S ` s→ s.

Proof. Let s be any term. The following deduction shows that ` s→ s.

1. ` s→ ((s→ s)→ s) LA(i)2. (s→ ((s→ s)→ s))→ ((s→ (s→ s))→ (s→ s)) LA(ii)3. ` (s→ (s→ s))→ (s→ s) MP1,24. ` s→ (s→ s) LA(i)5. ` s→ s MP3,4.

Since the empty set is a subset of any set, we then have S ` s → s by lemma6.3. �

Theorem 7.2 (The Deduction Theorem). Suppose that S is a set of propositionalterms and s and t are propositional terms. Then

S ∪ {s} ` t if and only if S ` s→ t.

Note that this captures a property of informal proofs: if we want to prove that someproposition P implies another Q, we would often assume P and show Q. The deductiontheorem tells us that this is captured in our formal system.

Proof. First, the easy direction. Suppose S ` s → t. Then there is a deductionS ` t1, . . . , S ` tn where tn is s → t. We can change this to a deduction S ∪ {s} `t1, . . . , S ∪{s} ` tn as in the proof of lemma 6.3. We then add two lines at the end ofthis deduction:

n. S ∪ {s} ` s→ t

n+1. S ∪ {s} ` s NLA

n+2. S ∪ {s} ` t MPn,n+1.

To show that if S ∪{s} ` t then S ` s→ t we suppose that S ∪{s} ` t So we havea deduction S ∪ {s} ` t1, . . . , S ∪ {s} ` tn, where tn is t. We will show, by inductionon i, that there is a deduction of S ` s→ ti.

Suppose that i = 1. The line S ∪ {s} ` t1 is either a logical axiom of a nonlogicalaxiom. Suppose that it is a logical axiom. Then we can use the following deduction.

1. S ` t1 LA

2. S ` t1 → (s→ t1) LA(i)

3. S ` s→ t1 MP1,2.

Here, LA is whichever logical axiom we used in line 1. of the original deduction.

If the first line is a nonlogical axiom, that is t ∈ S ∪ {s}, then there are two cases,t1 ∈ S and t1 is s. In the first case, we use the following.

1. S ` t1 NLA

2. S ` t1 → (s→ t1) LA(i)

3. S ` s→ t1 MP1,2.

In the second case we use the previous lemma, which showed that S ` s→ s to supplythe deduction.

Page 24: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

24

Now suppose that i > 1 and that for j < i we have a deduction with last lineS ` s → tj . We need to find a deduction of S ` s → ti. The ith line in our originaldeduction is either a logical axiom, a nonlogical axiom or an application of modusponens. In the first two cases, we can proceed as in the case i = 1. So suppose thatthere are j, k < i such that tj is tk → ti. We have

...

j. S ∪ {s} ` tk → ti...

k. S ∪ {s} ` tk...

i. S ∪ {s} ` ti MP j,k

By our induction hypothesis, we can find a deduction

...

nj . S ` s→ (tk → ti)

...

nk. S ` s→ tk...

ni−1. S ` s→ ti−1.

We add the following lines at the end:

ni−1 + 1. S ` (s→ (tk → ti))→ ((s→ tk)→ (s→ ti)) LA(ii)

ni−1 + 2 S ` (s→ tk)→ (s→ ti) MPnj , ni−1 + 1

ni−1 + 3 S ` s→ ti MPnkni−1 + 2.

This completes the proof.

We now allow ourselves to use the deduction theorem in deductions. We indicatethis by

n. S ` s→ t

n+1. S ∪ {s} ` t DT

or

n. S ∪ {s} ` t

n+1. S ` s→ t DT.

Note that formally these are not deductions. But the deduction theorem tells usthat the required deductions exist, so we can proceed as though they are.

For the next few lemmas, we fix some propositional terms s and t.

Lemma 7.3. ` s→ (¬s→ t)

Proof. Here is the required deduction.

Page 25: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

25

1. {s,¬s} ` ¬s→ (¬t→ ¬s) LA(i)2. {s,¬s} ` ¬s NLA3. {s,¬s} ` ¬t→ ¬s MP1,24. {s,¬s} ` (¬t→ ¬s)→ (s→ t) LA(iv)5. {s,¬s} ` (s→ t) MP3,46. {s,¬s} ` s NLA7. {s,¬s} ` t MP5,68. {s} ` ¬s→ t DT9. ` s→ (¬s→ t) DT

Lemma 7.4. ` (s→ ¬s)→ ¬s.

Proof. Here is the required deduction.

1. {s→ ¬s} ` ¬¬s→ s LA(iii)2. {s→ ¬s,¬¬s} ` s DT3. {s→ ¬s,¬¬s} ` s→ ¬s NLA4. {s→ ¬s,¬¬s} ` ¬s MP2,35. {s→ ¬s,¬¬s} ` s→ (¬s→ ¬(s→ s)) Lemma 7.36. {s→ ¬s,¬¬s} ` ¬s→ ¬(s→ s) MP2,57. {s→ ¬s,¬¬s} ` ¬(s→ s) MP4,68. {s→ ¬s} ` ¬¬s→ ¬(s→ s) DT9. {s→ ¬s} ` (¬¬s→ ¬(s→ s))→ ((s→ s)→ ¬s) LA(iv)

10. {s→ ¬s} ` (s→ s)→ ¬s MP8,911. {s→ ¬s} ` s→ s Lemma 7.112. {s→ ¬s} ` ¬s MP10,1113. ` (s→ ¬s)→ ¬s DT

Lemma 7.5. ` s→ ¬¬s.

Proof. Here is the deduction.

1. ` ¬¬¬s→ ¬s LA(iii)2. ` (¬¬¬s→ ¬s)→ (s→ ¬¬s) LA(iv)3. ` s→ ¬¬s MP1,2.

Lemma 7.6. ` ¬s→ (s→ t).

Lemma 7.7. ` s→ (¬t→ ¬(s→ t)).

Page 26: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

26

8. The completeness theorem

Definition 8.1. A set S of propositional terms is consistent if there is some propo-sitional term t such that there is no deduction of t from S. And S is inconsistent ifS ` t for every term t.

Lemma 8.2. Let S be a set of propositional terms and let s be a term. Then S ∪ {s}is inconsistent if and only if S ` ¬s.

Proof. Suppose S ∪ {s} is inconsistent. Then there is deduction S ∪ {s} ` ¬s. Weextend this as follows:n. S ∪ {s} ` ¬sn+1. S ` s→ ¬s DTn+2. S ` (s→ ¬s)→ ¬s Lemma 7.4n+3. S ` ¬s MPn+1,n+2.

For the other direction suppose that S ` ¬s and let t be any term. We extend adeduction showing S ` ¬s as follows.

n. S ∪ {s} ` ¬sn+1. S ∪ {s} ` s NLAn+2. S ∪ {s} ` s→ (¬s→ t) Lemma 7.3n+3. S ∪ {s} ` ¬s→ t MPn+1,n+2n+4. S ∪ {s} ` t MPn,n+3

We will prove completeness in the following form.

Theorem 8.3 (Completeness Theorem v.1). Suppose that S is a consistent set ofpropositional terms. Then there is a valuation v such that v(S) = T.

We show how this implies the following.

Theorem 8.4 (Completeness Theorem v.2). Let S be a set of propositional terms andt a term. If S |= t then S ` t.

Proof of v.2 from v.1. Suppose that it is not the case that S ` t, which we write asS 0 t. We show that S 2 t (that is, it is not the case that S |= t). First, we have thatS 0 ¬¬t. By Lemma 8.2 the set S ∪{¬t} is consistent. By version 1 of Completeness,there is a valuation v say such that v(S ∪ {¬t}) = T. So S 2 t, as needed. �

The two versions of Completeness are equivalent. To see this we prove version 1assuming version 2.

Proof of v.1 from v.2. Suppose that S is a consistent set of terms but that there is novaluation v such that v(S) = T. Let t be an arbitrary term. Since S is unsatisfiable,we have S |= t. By version 2 of completeness, S ` t. But t was arbitrary, so S isinconsistent, a contradiction. �

Before we prove version 1, we give an important application of completeness. Firstwe need some lemmas.

Lemma 8.5. A set S of propositional terms S is inconsistent if and only if there is aterm s such that S ` ¬(s→ s).

Page 27: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

27

Proof. For the nontrivial direction, suppose that S ` ¬(s→ s) for some s and let t beany term. Then we have a deduction as follows.

n. S ` ¬(s→ s)n+1. S ` s→ s Lemma 7.1n+2. S ` (s→ s)→ (¬(s→ s)→ t) Lemma 7.3n+3. S ` ¬(s→ s)→ t MPn+1,n+2n+4. S ` t MPn,n+3. �

Lemma 8.6. Suppose that S is a set of terms, t a term and that S ` t. Then there isa finite set S′ ⊆ S such that S′ ` t.

Proof. Let S ` t1, . . . , S ` tn be a deduction of S ` t. Let S′ be the set of s ∈ Sthat occur as a nonlogical axiom. Then S′ is finite and S′ ` t1, . . . , S′ ` tn is a validdeduction. �

Theorem 8.7 (The compactness theorem, v.1). Suppose that S is a set of propositionalterms. Then S is satisfiable if and only if every finite subset S′ ⊆ S is satisfiable.

Proof. For the nontrivial direction suppose that S is unsatisfiable. By version 1 of thecompleteness theorem, S is inconsistent. Let s be any term. Then S ` ¬(s → s),since S is inconsistent. By the previous lemma, there is a finite set S′ ⊆ S such thatS′ ` ¬(s→ s). By lemma 8.5 the set S′ is inconsistent. So by the soundness theorem,S′ is unsatisfiable. (To see this last step, suppose that S′ was satisfiable. Then therewould be a valuation v such that v(S′) = T. Now, S′ ` ¬(s → s), so by Soundness,S′ |= ¬(s→ s), and then v(¬(s→ s)), which is impossible.) �

Theorem 8.8 (The compactness theorem, v.2). Suppose that S is a set of terms andthat t is a term. Then S |= t if and only if there is a finite set S′ ⊆ S such that S′ |= t.

Again this is equivalent to v.1.

Proof of Compactness v.2 from v.1. For the difficult direction, suppose that S |= t butthat for every finite S′ ⊆ S we have S′ 2 t. Then for every finite S′ ⊆ S there is avaluation v such that v(S′) = T and v(t) = F. So every finite subset of S ∪ {¬t} issatisfiable. By compactness version 1, S ∪ {¬t} is satisfiable. So that is a valuation vsuch that v(S ∪ {¬t}) = T, i.e, v(S) = T and v(t) = F, contradicting S |= t. �

For the converse, see the exercsise sheets.

For an exercise, prove this using completeness (both versions).

Here is an example of an application of compactness.

Suppose that L,L′ are propositional languages and that S ⊆ SL, and S′ ⊆ SL′ aresuch that S ∪ S′ is unsatisfiable. Show that there exist t ∈ SL and t′ ∈ SL′ such thatS |= t and S′ |= t′ and t |= ¬t′.

To see this, we first apply compactness v.1 to the set S ∪ S′. This gives us a finiteset T ⊆ S ∪ S′ such that T is unsatisfiable. Let T = {s1, . . . , sn, s′1, . . . , s′m} wheresi ∈ S and s′j ∈ S′ and n,m ≥ 1. (If there were none from say S′, we could always adda term from S′.) Then there is no valuation v such that v(si) = T and v(s′j) = T forall i, j. So the set {s1∧· · ·∧sn, s′1∧· · ·∧s′m} is unsatisfiable. So if v(s1∧· · ·∧sn) = Tthen v(s′1 ∧ · · · ∧ s′m) = F. Hence with t taken as s1 ∧ · · · ∧ sn and t′ as s′1 ∧ · · · ∧ s′mwe have t |= ¬t′. And clearly S |= t and S′ |= t′, so we’re done.

For a second example, suppose that S = {si : i ∈ N} is a set of terms such thatsi |= sj if and only if j ≤ i. Show that S is satisfiable.

Page 28: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

28

To prove this, suppose that S is unsatisfiable. By compactness v.1 there is a finiteS′ ⊆ S which is unsatisfiable. Let n be the largest integer such that sn ∈ S′. If v is avaluation such that v(sn) = T then by our assumption we have v(si) = T for all i ≤ nand then v(S′) = T, a contradiction. So there is no valuation v such that v(sn) = T.But then sn |= sn+1, contradicting our assumption. So S is satisfiable.

We now return to proving completeness. We need one final lemma.

Lemma 8.9. Suppose that S is a set of terms and that s is a term. If S ` s andS ` ¬s then S is inconsistent.

Proof. Let t be any term. By Lemma 7.3 we have S ` s → (¬s → t). By ourassumption, S ` s and S ` ¬s. We then get S ` t by applying modus ponenstwice. �

Proof of v1 of the Completeness theorem. We want to show that if S is consistent thenthere is a valuation v such that v(S) = T. Suppose that a consistent set of terms S isgiven. We will assume that the set L of p.v. is countable. It follows that the set SLof terms is countably infinite. So we can write SL = {t0, t1, . . .}.

We inductively define sets Tn of terms, for n ≥ 0, as follows:

T0 = S

Tn+1 =

{Tn ∪ {tn} if Tn ` tnTn ∪ {¬tn} otherwise

Let T =⋃

n≥0 Tn. We will show that T is a maximal consistent set of sentences.

That is, T is consistent and any set T ′ 6= T such that T ⊆ T ′ is inconsistent.

First, we show that each Tn is consistent. For T0 this is our assumption, so supposethat Tn is consistent. If Tn ` tn then by lemma 8.9 we have Tn 0 ¬tn. So by lemma8.2 Tn+1 ∪ {tn} is consistent. If Tn 0 tn then Tn 0 ¬¬tn so by lemma 8.2 Tn+1 isconsistent. So each Tn is consistent.

If T is inconsistent, then T ` ¬(t → t) for some term t. By lemma 8.6 there isa finite T ′ ⊆ T such that T ′ ` ¬(t → t). Since T =

⋃Tn, there is some n such

that T ′ ⊆ Tn and so Tn ` ¬(t → t). By lemma 8.5 the set Tn is inconsistent, acontradiction. So T is consistent after all.

To show that T is maximal consistent, let t be any term. Then t is tn for some n.So either t ∈ T or ¬t ∈ T . So if t /∈ T then ¬t ∈ T . And then by 8.9 T ∪ {t} isinconsistent. So T is a maximal consistent set of terms.

We aim to define a valuation v by v(t) = T if and only if t ∈ T . But we need someclaims.

First, we show that if T ` t then t ∈ T .

To see this, suppose that T ` t but that t /∈ T . Then T ∪ {t} is inconsistent, so by8.2 we have T ` ¬t. But then by lemma 8.9 T is inconsistent, a contradiction.

Second, we show that s→ t ∈ T if and only ¬s ∈ T or t ∈ T .

To see this, first suppose that ¬s ∈ T . Then by lemma 7.6 we have T ` s→ t andthen by the first claim s → t ∈ T . If t ∈ T then it is an exercise using the first claimto show that s→ t ∈ T . For the other direction, suppose that ¬s /∈ T and that t /∈ T .Since for every term r either r ∈ T or ¬r ∈ T , we have s ∈ T and ¬t ∈ T . By lemma7.7 we have T ` ¬(s→ t) so ¬(s→ t) ∈ T by the first claim, and so s→ t /∈ T .

Page 29: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

29

Finally, we define a function v on the set of terms by v(t) = T if and only if t ∈ T .We want to show that v is a valuation. It is sufficient to check the ¬ and → clauses,since the set {¬,→} is adequate. The clause for → is exactly the second claim above,so we only need to check the clause for ¬. If v(t) = T then t ∈ T so ¬t /∈ T and thenv(¬t) = F. And if v(t) = F then t /∈ T so ¬t ∈ T and v(¬t) = T.

This valuation is such that v(T ) = T. And since S ⊆ T , we have v(S) = T as wewanted. �

Page 30: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

30

9. Predicate logic: the basic language

We begin by giving an overview, which is meant to give ideas, rather than to beprecise. Predicate logic has much more expressive power than the propositional logicwe studied earlier. We will be able to form statements about ‘sets with structure’. Inparticular, we will be able to talk about elements of sets. We will have variable symbolsx, y, x1, x2, . . . , y1, y2, . . . which, when interpreted, range over a give set. We will alsohave quantifiers ∀,∃ (‘for all’ and ‘there exists’). So a formula in predicate logic could,for example, begin ∀x∃y · · · . What we are allowed to include in the formula will dependon the structure we are studying. We will have different languages for different types ofstructure. We give a language by choosing certain symbols which stand for constants,certain symbols standing for relations and certain symbols standing for functions.

Let’s give some examples. Our sets-with-structure will always include = ( a 2-ary, orbinary relation) and we will always have a binary relation symbol in our language, alsodenoted by =. We might also have, for instance, an ordering, e.g. ≤ in in the integersZ or the real numbers R. This is another binary relation, and if we wanted to study itwe could include another binary relation symbol in our language. If we wanted to talkabout arithmetic in Z or R we could add binary function symbols, to be interpreted as+ and ×, and perhaps constant symbols to be interpreted as 0 and 1.

Before getting onto these, we start with the basic language. So, with the overviewover, the basic language L0 has the following symbols:

(1) the propositional connectives, ∧,∨,→,↔,¬ and brackets (, );(2) countably many variable symbols x, y, z, . . . , v0, v1, . . .;(3) quantifier symbols ∃,∀;(4) equality symbol =.

(To be more formal, we should distinguish the relation symbol = from the actualrelation =, but we will not do this.)

A term of L0 is just a variable, and the free variable of a term is the variable thatmakes up the term: fv(x) = {x} for any variable x.

An atomic formula of L0 is an expression s = t where s, t are terms. We definefv(s = t) = fv(s) ∪ fv(t) [note the different roles of the two equals signs here].

We define the formulas of L0, and their free variables, as follows:

(1) Every atomic formula is a formula.(2) If φ is a formula then so is ¬φ, and fv(¬φ) = fv(φ).(3) If φ, ψ are formulas then so are φ∧ψ, φ∨ψ, φ→ ψ and φ↔ ψ and fv(φ∧ψ) =

fv(φ ∨ ψ) = fv(φ→ ψ) = fv(φ↔ ψ) = fv(φ) ∪ fv(ψ).(4) If φ is a formula and x is a variable symbol then ∃xφ and ∀xφ are formulas,

and fv(∃xφ) = fv(∀xφ) = fv(φ) \ {x}.(5) Nothing else is a formula of L0.

A sentence of L0 is a formula σ of L0 such that fv(σ) = ∅.We use brackets to help readability. To be more formal, we should be careful with

brackets as we were with propositional logic (at the beginning), but we won’t do this.

Here are some examples of formulas of L0

x = y is a formula, with free variables x, y.

∀x(x = y) is a formula, with free variable y.

∃x∀y(x = y ∧ y 6= z) is a formula with free variable z. (Note that we use y 6= z toabbreviate ¬(y = z).)

main
Highlight
main
Highlight
main
Highlight
main
Highlight
main
Typewriter
Important notions in sections 9-13 are highlighted in the text below. You can find examples with solutions at https://personalpages.manchester.ac.uk/staff/Marcus.Tressl/teaching/MathematicalLogic/MATH20302ExamplesWithSolutions.pdf
Page 31: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

31

∃x(x = y ∧ y 6= z) is a formula with free variables y, z.

∃w∀x∀y∀z(x = w ∨ y = w ∨ z = w) is a formula with no free variables, that is,it is a sentence. (Try to figure out what this sentence says. Although we haven’t yetdefined meaning for formulas, we can and will later, and you can try to guess at whatthis says.)

The definition of formulas is inductive, just like the definition for propositional terms,and each formula has a corresponding construction tree. Any formula that occurs inthe tree for φ is called a subformula of φ. Just like with propositional terms, eachformula has a principle connective (and there is a unique readability theorem, but wewon’t study that).

Here is an example.

∃x∀y(x = y ∧ y 6= z)

∀y(x = y ∧ y 6= z)

x = y ∧ y 6= z

¬(y = z)

y = z

x = y

And we can see that for instance y = z and ∀y(x = y ∧ y 6= z) are subformulas of∃x∀y(x = y ∧ y 6= z) but that ∃x(x = y ∧ y 6= z) is not.

We define the free occurrences of a variable x in a formula as follows:

(1) Every occurrence of x in any atomic formula is free.(2) The free occurrences of x in ¬φ are the free occurrences of x in φ.(3) If ∗ is one of ∧,∨,→,↔ then the free occurrences of x in φ ∗ ψ are the free

occurrences of x in φ together with the free occurrences of x in ψ.(4) There are no free occurrences of x in ∃xφ, and no free occurrences of x in∀xφ.

In a formula of the form Qxφ where Q is either ∀ or ∃, we refer to φ as the scopeof Qx. Any free occurrence of x in φ is said to be bound by Qx.

For instance, in the formula ∃x(x = y ∧ y 6= z) ∧ ∀z(x = z) the variable y is free.The first occurrence of z is free, the second is bound by ∀z. The second occurrenceof x is free, the first is bound by ∃x. The scope of the first ∃x is the subformula(x = y ∧ y 6= z), the scope of the ∀z is (x = z).

Now consider the formula

∃x((∀x(x = x))→ x = x).

The scope of the quantifier ∃x is ((∀x(x = x)) → x = x). But the first x = x herelies in the scope of the ∀x, so these xs are bound by ∀x, while the second x = x arebond by ∃x.

Instead of this formula, we could also write

∃x((∀y(y = y)→ x = x).

main
Highlight
main
Highlight
main
Highlight
main
Highlight
Page 32: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

32

This formula is different, but it has the same meaning (it is logically equivalent, thoughwe won’t formally define this). It is also much easier to read!

Page 33: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

33

10. Predicate logic: enriching the language

Here are some more examples of formulas in our basic language.

• ∀x(x = x)• ∀x∀y(x = y → y = x)• ∀x∀y∀z((x = y ∧ y = z)→ x = z)• ∃x∃y∃z(x 6= y ∧ x 6= z ∧ y 6= z ∧ ∀w(w = x ∨ w = y ∨ w = z))• ∃x(x 6= x)• ∀x∃y(x 6= y).

Try to think about what these say, when we interpret them in a set. For instance, isthe first one always true? For which sets is the last one true?

There isn’t a lot we can say with our basic language. To get more a more expressivelogic, we now add symbols for constants, relations and functions.

So, suppose that S is a collection of constant symbols, function symbols (perhapsof different arities) and relation symbols (perhaps of different arities), where we mighthave, say, no relation symbols. We write L for L0∨S (we explain this notation below).The terms of L, and their free variables, are defined as follows.

(1) Each variable symbol is a term, and fv(x) = {x},(2) Each constant symbol c is a term, and fv(c) = ∅, (the empty set)(3) If f is an n-ary function symbol and t1, . . . , tn are terms, then f(t1, . . . , tn) is

a term, and fv(f((t1, . . . , tn)) = fv(t1) ∪ · · · ∪ fv(tn)),(4) Nothing else is a term.

Suppose for example that our collection S includes three constant symbols c1, c2, c3a 2-ary function symbol f and a 3-ary function symbol g. We give some examples ofterms of L and their free variables;

Term Free variablesc1 ∅c2 ∅

g(c1, c2, c3) ∅g(x, c1, c2) xg(x, y, z) x, y, z

f(g(c1, x, y), c2) x, yf(g(x, y, c1), f(x, c2)) x, y

We define the atomic formulas of L as follows.

(1) If s, t are terms then s = t is an atomic formula, and fv(s = t) = fv(s)∪fv(t).(2) If R is an n-ary relation symbol, and t1, . . . , tn are terms, then R(t1, . . . , tn)

is an atomic formula, and fv(R(t1, . . . , tn)) = fv(t1) ∪ · · · ∪ fv(tn).

The formulas of L are then defined as in the case of the basic language, but withthe more general definitions of terms and atomic formulas. So

(1) Every atomic formula is a formula.(2) If φ is a formula then so is ¬φ, and fv(¬φ) = fv(φ).(3) If φ, ψ are formulas then so are φ∧ψ, φ∨ψ, φ→ ψ and φ↔ ψ and fv(φ∧ψ) =

fv(φ ∨ ψ) = fv(φ→ ψ) = fv(φ↔ ψ) = fv(φ) ∪ fv(ψ).(4) If φ if a formula and x is a variable symbol then ∃xφ and ∀xφ are formulas,

and fv(∃xφ) = fv(∀xφ) = fv(φ) \ {x}.(5) Nothing else is a formula of L.

main
Highlight
main
Highlight
main
Highlight
main
Highlight
main
Highlight
main
Highlight
main
Highlight
main
Highlight
Page 34: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

34

A sentence of L is a formula with no free variables.

We define free occurrences, scope, subformulas and so on as before.

The idea with the notation L0 ∨ S is that our language is some sort of join of thebasic language and S, rather than literally the union.

To see what the definitions of terms and formulas mean we write them out again ina special case. We take our extra symbols S to be:

• two constant symbols c, d,• two binary function symbols f, g,• a binary relation symbol R.

Then the terms of L are the strings of symbols formed by finitely many applicationsof the following rules:

(1) all the variable symbols x, y, z, v1, v2, . . . are terms,(2) the constant symbols c, d are terms,(3) if t1, t2 are terms, then f(t1, t2) is a term and g(t1, t2) is a term,(4) nothing else is a term.

To see whether a string is a term, we can try to form a construction tree.

For example,

f(x, c)

cx

At the bottom of the tree, we have x and c, both of which are terms. Then above, wehave f(x, c), which is formed by applying one of the rules. So we get a term.

Here is a non-example. We can see that g(c, f(y)) is not a term, by trying to drawa tree, and seeing what happens:

g(c, f(y))

f(y)

y

c

At the bottom of the tree we have y which is a term, but above it we have f(y), butf is 2-ary, so f(y) is not a term according to the rules. Hence we can’t use it to formother terms, and so g(c, f(y)) is not a term.

Similarly, we can see that g(g(g(x, y), d), f(x, g(c, d))) is a term. Again, we try todraw the tree:

main
Highlight
main
Highlight
Page 35: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

35

g(g(g(x, y), d), f(x, g(c, d)))

f(x, g(c, d))

g(c, d)

dc

x

g(g(x, y), d)

dg(x, y)

yx

We can see from the tree that this is a term.

We do one more example.

f(g(c,R(x, y)), g(x, d))

g(x, d)

dx

g(c,R(x, y))

R(x, y)c

On the right hand side, x and d are terms, and then g(x, d) is a term following therules. But on the left, at the bottom we have R(x, y). This is not a term: there is noway to introduce the relation symbol R in the definition of terms.

The atomic formulas of L are strings of symbols of one of the following forms:

• t1 = t2 where t1, t2 are terms of L,• R(t1, t2) where t1, t2 are terms of L.

We then define the formulas as before.

We now determine whether some strings of symbols are formulas of L. We do thisby trying to draw a construction tree, and seeing what happens.

∃x∀y(R(x, y)→ R(y,R(y, x)))

∀y(R(x, y)→ R(y,R(y, x)))

R(x, y)→ R(y,R(y, x))

R(y,R(y, x))R(x, y)

This is not a formula, as at the end of the tree on the right we have R(y,R(y, x)),which is not an atomic formula, since R(y, x) isn’t a term (as in the last nonexampleof a term above).

The next example is a formula, and we underline the free variables at each point.

main
Highlight
main
Highlight
Page 36: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

36

∃x∀y(R(z, v)→ f(c, y) = g(x, f(z, v)))

∀y(R(z, v)→ f(c, y) = g(x, f(z, v)))

R(z, v)→ f(c, y) = g(x, f(z, v))

f(c, y) = g(x, f(z, v))R(z, v)

At the bottom here we have atomic formulas. (To be more precise, we should alsocheck that f(c, y) and g(x, f(z, v)) are terms. This can be done as in the term examplesabove.) Then everything above is formed followig the rules, so what we get is a formula.(After the tree is completed, we can go back up underlining the free variables.)

For a final example, consider

∃x(∀x(R(x, y)→ f(x, y) = v) ∧ g(x, c) = d).

Let’s check that this is a formula (it is!) using a tree.

∃x(∀x(R(x, y)→ f(x, y) = v) ∧ g(x, c) = d)

∀x(R(x, y)→ f(x, y) = v) ∧ g(x, c) = d

g(x, c) = dR(x, y)→ f(x, y) = v

f(x, y) = vR(x, y)

Once we’ve found that this is a formula, we can go back up underlining the free variables.

Page 37: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

37

11. L-structures

We interpret the terms and formulas of a language L in certain structure, calledL-structures.

In propositional logic, to interpret terms, we only needed to give a value T or F toeach p.v., and this determined everything. Here we need more. We need a set for thevariables to range over, and a meaning for the constant symbols, function symbols andrelation symbols.

So, an L-structure M consists of a nonempty set M together with

(1) a distinguished element cM of M for each constant symbols c of L,(2) a subset RM of Mn for each n-ary relation symbol of L, and each n,(3) a function fM : Mn →M for each n-ary function symbol f of L and each n.

We call cM, RM and fM the interpretations of the symbols c,R and f , respectively.We make this explicit in the notation by writing M = (M, {cM}, {RM}, {fM}).

For an example, suppose that we have the language considered in the previoussection, with two constant symbols c, d, two binary functions symbols f, g and a binaryrelation symbol R. Then the following are examples of L-structures:

(1) Take M = R, RM = {(x, y) ∈ R2 : x < y}, fM(x, y) = x + y, gM =x · y, cM = 0, dM = 1.

(2) Same, but with M = Q.(3) Or we could take M = R, RM = {(x, y) ∈ R2 : x2 + y2 = 1}, fM(x, y) =

x2 + y2, gM = x3 + y3, cM = −1, dM = 1.(4) Or we could take M = {a1, a2, a3, b1, b2, b3}, cM = a1, d

M = b1, RM =

{(ai, bj) : i, j = 1, 2, 3} and

fM(x, y) =

{a1 if x 6= y

b1 if x = y

gM(x, y) =

{a2 if x 6= y

b2 if x = y.

Note how different these are. All they have in common is their ‘structure’: each hastwo distinguished elements, a distinguished subset of the square of the universe, andtwo distinguished binary functions.

Suppose that our language includes a binary relation symbol R. We can drawpictures of finite L-structures M, by viewing RM as the edge relation of a directedgraph. That is, we have vertices, on for each x ∈ M and an edge from x to y if andonly if (x, y) ∈ RM.

We do a few examples. Suppose that we have a single binary relation R in ourlanguage. Then the following are L-structures (pictures below).

(a) M = {a, b, c, d}, RM = {(a, b), (b, c), (c, d), (d, a)}.

(b) M = {a, b, c, d}, RM = {(a, b), (a, c), (a, d), (b, a), (b, c), (b, d)}.

(c) M = {a, b, c, d, e}, RM = {(a, a), (a, b), (a, c), (b, b), (b, d), (c, d), (d, d)}.

main
Highlight
main
Highlight
main
Highlight
main
Highlight
main
Highlight
Page 38: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation
Page 39: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

39

12. Interpreting terms in L-structures

We can interpret terms of L in our L-structures. Informally, terms define functionssimply by interpreting constant symbols and n-ary function symbols as elements of Mand functions Mn →M , respectively, and by interpreting variable symbols as variablesranging over M .

For instance, suppose we have a language L = L0 ∨ {f, g, c} where f is a unaryfunction symbol, g is a binary function symbol and c is a constant symbol. Consider theL-structure M = (N, fM, gM, cM), where M = N, fM(x) = x2, gM(x, y) = x + yand cM = 5. Then the term

g(c, f(x))

gives the function N→ N defined by

x 7→ gM(cM, fM(x))

= cM + fM(x)

= 5 + x2.

That is, the interpretation of this term in this structure gives the function x 7→ 5 + x2.

For a second example, consider the term

f(g(c, g(x, f(y)))).

We can unravel this as follows:

fM(gM(cM, gM(x, fM(y)))) = (gM(cM, gM(x, fM(y))))2

= (cM + gM(x, fM(y)))2

= (5 + x+ fM(y))2

= (5 + x+ y2)2.

So this term, interpreted in M gives the function N2 → N defined by

(x, y) 7→ fM(gM(cM, gM(x, fM(y)))).

Now we give the formal definition. This is not covered in lectures, and theinformal way above is the right way to think about it. But I include the formaldefinition for completeness.

As these example might suggest, the definition is inductive. It is easiest to formulatewith only variable symbols v1, v2, v3, . . .. (In practice, we will also use x, y, z, w and soon, and it should be clear how to do this.)

Fix a language L and an L-structure M. Given a term t of L, we define a function

tM : M∞ →M,

where M∞ = {m̄ : m̄ = (m1,m2,m3, . . . ,mp, . . .),mp ∈ M,p ≥ 1}, that is M∞ isthe set of all infinite sequences of elements of M . For m̄ ∈M∞, we define tM(m̄) byinduction as follows:

(1) if t is a variable symbol vp then vMp (m̄) = mp,

(2) if t is a constant symbol c then cM(m̄) = cM,(3) if t is f(t1, . . . , tn) where t1, . . . , tn are terms of L and f is an n-ary function

symbol, then

tM(m̄) = fM(tM1 (m̄), . . . , tMn (m̄)).

main
Highlight
Page 40: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

40

It is easy to show that tM(m̄) only depends on the elements mp such that vp occursin t. This mean that in practice, we can think of tM as a function of finitely manyvariables, rather than infinitely many variables.

This is the formal definition, but in practice, we continue to work out examples as wedid with the example above. Here is another example, where now L = L0∨{f, g, c, d},with binary function symbols f, g and constant symbols c, d. Suppose our L-structureis given by M = Z, fM(x, y) = x+ y, gM = x− y, cM = 17, dM = 19. Consider theterm t given by

f(g(g(f(x, x), g(x, y)), c), d).

We have

fM(gM(gM(fM(x, x), gM(x, y)), cM), dM) = gM(gM(fM(x, x), gM(x, y)), cM) + dM

= gM(fM(x, x), gM(x, y))− cM + 19

= fM(x, x)− gM(x, y)− 17 + 19

= 2x− (x− y) + 2

= x+ y + 2.

So the function tM : M2 →M is given by (x, y) 7→ x+ y + 2.

For another example, continue with this L and takeM given by M = R, fM(x, y) =x+ y, gM(x, y) = xy, cM = 0, dM = 1. Consider the L-term t as above, so given by

f(g(g(f(x, x), g(x, y)), c), d).

Then in this new M, we have

tM(x, y) = fM(gM(gM(fM(x, x), gM(x, y)), cM), dM)

= gM(gM(fM(x, x), gM(x, y)), cM) + dM

= gM(fM(x, x), gM(x, y)) · cM + 1

= gM(fM(x, x), gM(x, y)) · 0 + 1

= 1

So in this structure, the term t is just a complicated way of writing the function withconstant value 1.

Page 41: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

41

13. Interpreting formulas in L-structures

When we interpret the symbols of L in an L-structureM and interpret the quantifiersas ranging over M and the propositional connectives as we did in propositional logic, asentence of L makes an assertion about M. When this assertion is true, we say thatthe sentence is true inM. When the assertion is false, we say that the sentence is falsein M.

As with the interpretation of terms, there is a complicated formal definition, whichwe give below for completeness. But it is much easier to get the idea by looking atexamples.

For instance let L = L0∨{R, f, c} where f is a unary function symbol, c a constantsymbol and R a binary relation symbol. Let M be given by M = R, RM = {(x, y) ∈R2 : x < y}, fM(x) = x2 and cM = 0. Let φ be the sentence of L given by

∀x(R(c, x)→ ∃y(x = f(y))).

Interpreting this in M, we have

∀x ∈ R(0 < x→ ∃y ∈ R(x = y2)).

And this is true in M, so we say that φ is true in M.

If we instead consider M given by M = Q and RM = {(x, y) ∈ Q2 : x <y}, fM(x) = x2 and cM = 0, then in this new M our sentence φ says

∀x ∈ Q(0 < x→ ∃y ∈ Q(x = y2)).

So φ is false in M, as for instance 0 < 2 but 2 6= y2 for any rational y.

Next consider this M again, but with fM(x) = 2x. Then in this M our sentenceφ says

∀x ∈ Q(0 < x→ ∃y ∈ Q(x = 2y))

which is true, so we say that φ is true in this M.

For another example, let L have a binary relation symbol R, a unary function symbolf and constant symbols c, d. Let M be given by M = Q, RM = {(x, y) ∈ Q2 : x <y}, fM(x) = x2, cM = 0, dM = 1. Let φ be the sentence

∃x(R(x, f(x))→ (x = c ∧ x = d)).

Interpreted in M this says

∃x ∈ Q((x < x2)→ (x = 0 ∧ x = 1)).

Now the (x = 0 ∧ x = 1) is always false. So the sentence will only be true if there issome x ∈ Q such that x < x2 is false. (Then we will have ‘false implies false’, whichis true.) There are such x, e.g. x = 0. So the sentence is true in M.

If instead of a sentence φ, we consider an L-formula φ with a free variable x, whichwe indicate by φ(x), then φ doesn’t make an assertion about an L-structure M. Butif we also given an element m ∈ M , then φ(m), that is, ‘φ with m substituted in forall free occurrences of x’ does make an assertion, about m in M.

For instance, continue with the L from the start of this section, with a binary relationsymbol R, a unary function symbol f and a constant symbols c. Let M = Q, RM ={(x, y) ∈ Q : x < y}, fM = x2 and cM = 0. Consider the formula

R(c, x)→ ∃y(x = f(y)).

Then if we interpret in M and ‘substitute 2 for the free occurrences of x’ we get

0 < 2→ ∃y ∈ Q(2 = y2).

Page 42: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

42

And this is false (as the 0 < 2 is true and the ∃y ∈ Q(2 = y2) is false), so we say φ(2)is false in M. On the other hand, if we interpret in M and ‘substitute 4 for the freeoccurrences of x’ we get

0 < 4→ ∃y ∈ Q(4 = y2).

And this is true. So we say that φ(4) is true in M.

For the formal definition again not given in lectures, which is due to Tarski, wewill again work only with variables v1, v2, v3, . . . (and again, we’ll apply the result moregenerally, see later). Suppose that φ is an L-formula and thatM is an L-structure andthat m̄ ∈M∞. We write M |= φ(m̄), and say ‘φ is true of m̄ in M’ if:

(1) φ is an atomic formula of the form t1 = t2, for terms t1 and t2 and thenM |= φ(m̄) if and only if tM1 (m̄) = tM2 (m̄), or,

(2) φ is an atomic formula of the form R(t1, . . . , tn) and then M |= φ(m̄) if andonly if (tM1 (m̄), . . . , tMn (m̄)) ∈ RM, or,

(3) φ is ψ∧ θ and thenM |= φ(m̄) if and only ifM |= ψ(m̄) andM |= θ(m̄), or,(4) φ is ¬ψ and thenM |= φ(m̄) if and only if it is not the case thatM |= ψ(m̄),

or,(5) φ is ∃vpψ and then M |= φ(m̄) if and only if there exists n ∈ M such thatM |= φ(m̄(p/n)), where m̄(p/n) denotes the sequence (m1, . . . ,mp−1, n,mp+1, . . .)of M∞.

Note that whether or not M |= φ(m̄) only depends on those mp such that vp occursfree in φ. Also, note that we haven’t defined what to do if φ is ψ → θ, ψ ∨ θ, ψ ↔ θor ∀vpψ. For the first three, we use that {¬,∧} is adequate, to reduce to somethingcovered by our definition. And for the last, we define M |= ∀vpψ if and only ifM |= ¬∃vp¬ψ. So these cases can all be covered by our definition.

Finally, if φ is a sentence of L, we say that M is a model of φ is M |= φ(m̄) forsome (or equivalently for all) m̄ ∈M∞. So informally, M is a model of φ is φ is truein M.

Let’s work through an example of this definition, just to see how it works. Normally,we proceed without it (as we did in the examples before the definition). For theexample, we take L = L0 ∨ {P, f, g, c} where P is a unary relation symbol, f, g arebinary function symbols and c is a constant symbol. We take M to be given byM = {1, 2, 3, 4, . . . , }, the positive integers, PM = {2, 3, 5, 7, 11, 13, . . .}, the primes,fM(m,n) = m · n, gM(m,n) = m+ n and cM = 2. Let φ be the sentence

∀x∃y∃z(g(f(c, x), c) = g(y, z) ∧ P (y) ∧ P (z))

and let θ(x, y, z) be the formula g(f(c, x), c) = g(y, z) and ψ(y) be the formula P (y)and χ(z) be the formula P (z). Note that the term g(f(c, x), c) interpreted inM is thefunction x 7→ 2x + 2. We use a sequence m̄ = (mx,my,mz,m1,m2, . . .), indicatingwhich elements correspond to x, y, z and which to variables v1, v2, . . .. And we writem̄(x/n) for the sequence (n,my,mz,m1,m2, . . .), and similarly for m̄(y/n) etc.

Then we have

M |= φ(m̄) iff for every n ∈MM |= (∃y∃z(θ ∧ ψ ∧ χ)(m̄(x/n))

iff for every n ∈M there exist p, q ∈M s.t. M |= (θ ∧ ψ ∧ χ)(m̄(x/n)(y/p)(z/q))

iff for every n ∈M there exist p, q ∈M s.t. M |= (θ)(m̄(x/n)(y/p)(z/q))

and M |= (ψ)(m̄(x/n)(y/p)(z/q))

and M |= (χ)(m̄(x/n)(y/p)(z/q))

iff for every n ∈M there exist p, q ∈M s.t. 2n+ 2 = p+ q and p is prime and q is prime

iff every even natural number greater than 2 is the sum of two primes .

main
Highlight
main
Highlight
Page 43: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

43

And this is Goldbach’s conjecture, no one knows whether or not this is true.

Important notation. If φ is a sentence of L and M is an L-structure, we writeM |= φ is φ is true inM. As well as saying φ is true inM, we say thatM is a modelof φ, or that M models φ.

We will use this phrase M models φ even though the formal definition isn’t seenin lectures. In any given case, it is clear what is meant, working informally as we didearlier.

For further examples, we work informally. Take L = L0∨{R,P} where R is a binaryrelation symbol and P a unary relation symbol (or predicate symbol). LetM1 be givenby M = {1, 2, 3, . . .}, the positive integers, RM1 =≤, i.e. RM1 = {(x, y) ∈ M2 :x ≤ y} and PM1 = {x ∈ M : x is even }. And let M2 be given by M = R, the realnumbers, RM2 = {(x, y) ∈ R2 : x2 = y} and PM2 = Q.

Let φ be the L-sentence

∃x∀y∃z((P (x)→ R(x, y)) ∧ P (y) ∧ ¬R(x, y)).

This is true in an L-structure M if there is an a ∈ M such that for all b ∈ M thereis a c ∈M such that each of the conjuncts is true in M with a substituted in for x, bsubstituted in for y and c substituted in for z. Let’s consider each of M1 and M2.

InM1. Fix any x ∈M . If we choose y odd, then no matter what z is, P (y) will befalse. So the sentence φ is false in M1, and M1 2 φ. Similarly in M2, if we fix anyx ∈ R, and choose y ∈ R irrational, then no matter what z is, P (y) will be false. Soφ is false in M2, i.e. M2 2 φ.

Next consider the sentence ψ given by ∀y∃x(¬P (x)∧R(x, y)). What does this sayin M1 and M2? In M1, this says ‘for all positive integers y there is a positive integerx such that (x is odd and x ≤ y)’. This is true: no matter what y is we can takex = 1. So M1 |= ψ. And in fact the sentence ∃x∀y(¬P (x) ∧R(x, y)) is true in M1.

On the other hand, in M2, the sentence ψ says ‘for all reals y there is an irrationalx such that x2 = y’. This is false. For instance, if we take y = 4 then x2 = y if andonly if x = ±2, and neither of these values of x are irrational. So ψ is false inM2, i.e.M2 2 ψ.

Now we do an example in which L has a single binary relation symbol R. Let X be theL-structure given byX = {a, b, c, d, e, f} andRX = {(a, b), (a, c), (a, d), (a, e), (a, f), (b, d), (c, e), (c, f)}.First, in such an example, you should draw the directed graph (see the examples in thesection on L-structures). Here can be imagined as have a sitting on top. with b, c, d, e, farranged in a line below, and arrows from a to each of those below, and then arrowsfrom b to d, and from c to e and f .

Let φ be the sentence

∃x∀y((¬∃zR(z, y))→ y = x).

To examine this in X , first we consider the subformula

(¬∃zR(z, y))→ y = x.

This subformula says ‘if there is no z pointing to y then y = x. So the whole sentenceφ is true in X is there is some x ∈ X such that for an y ∈ X, if there is no z pointingto y then y = x. To see that this is indeed true in X take x = a. Now, if y 6= a then

¬∃zR(z, y)

is false (since something points to y), and the implication is true. On the other handif y = a then the x = y on the right is true, and the implication is true. So with thechoice x = a the implication is true for all y. So X is a model of φ.

main
Highlight
main
Highlight
main
Highlight
Page 44: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

44

Next let φ be the sentence

∃x∀y((¬∃zR(y, z))→ y = x).

(So the y and z are swapped from the previous example.) Now

¬∃zR(y, z)

says ‘y does not point to anything’. So the whole sentence says

‘there is an x such that for all y if y doesn’t point to anything then y = x’.

There are three elements, d, e, f of X that don’t point to anything. If we choose xto be one of these, then taking y to be another of these elements, y = x is false, and¬∃zR(y, z) is true. So the implication is false. (And if we choose x to be one of theother elements, then taking y to be d the implication is again false.) So the sentenceis false in X .

Page 45: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

45

14. Definable sets

Suppose that L = L0 ∨ S is a language as before and that φ is an L-formula withone free variable x (which we indicate by φ(x)). Given an L-structureM, we can lookat ‘the solution set’ of φ in M:

{m ∈M :M |= φ(x/m)} = {m ∈M :M |= φ(m)}= {m ∈M : φ is true in M with m substituted in for the free occurrences of x}.

This is called the set defined by φ in M, and written φ(M). Such sets are calleddefinable.

For example, take L = L0 ∨ {f} where f is a unary function symbol. Let φ(x) bethe formula ∃y(f(y) = x). We examine the set defined by φ in several L-structures.

Let M1 be given by M1 = N, the natural numbers, and fM1(x) = x2. Then

φ(M1) = {m ∈M1 :M1 |= φ(m)}= {m ∈ N : there exists n ∈ N s.t. m = n2}= the square numbers in N.

Let M2 be given by M2 = N, the natural numbers, and fM2(x) = 2x. Then

φ(M2) = {m ∈M2 :M2 |= φ(m)}= {m ∈ N : there exists n ∈ N s.t. m = 2n}= even numbers in N.

Next, let M3 be given by M3 = R, the real numbers, and fM3(x) = x2. Then

φ(M3) = {m ∈M3 :M3 |= φ(m)}= {a ∈ R : there exists b ∈ R s.t. a = b2}= {a ∈ R : a ≥ 0}= [0,∞).

Finally, consider M4 given by M4 = R, the real numbers, and fM4(x) = 2x. Then

φ(M4) = {m ∈M4 :M4 |= φ(m)}= {a ∈ R : there exists b ∈ R s.t. a = 2b}= R.

Here are some further examples. For these, suppose that L = L0 ∨ {R, f, c} whereR is a binary relation symbol, f a unary function symbol and c a constant symbol. LetM be the L-structure given by M = R, RM = {(x, y) ∈ R2 : x ≤ y}, fM(x) = cosxand cM = π.

Here is a table of formulas with a free variable x and the set they define in M.

Formula φ(x) φ(M)R(c, x) [π,∞)∃yf(y) = x [−1, 1]∃yf(x) = y Rf(x) = π ∅ (i.e. the empty set)

∃y(R(c, x) ∧ f(y) = x) ∅∃y(R(c, y) ∧ f(y) = x) [−1, 1]

∀yR(x, f(y)) (−∞,−1]∀yR(f(x), f(y)) {(2k + 1)π : k ∈ Z}

∀y∃z(R(y, z) ∧ f(z) = x) [−1, 1]

Page 46: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

46

Now let’s take N as the M above, but with RN = {(x, y) ∈ R2 : x < y} (so wechange to strict inequality. Let’s look at the same formulas, and the sets they definenow. The ones without an R in don’t change. For the rest we have:

Formula φ(x) φ(N )R(c, x) (π,∞)

∃y(R(c, x) ∧ f(y) = x) ∅∃y(R(c, y) ∧ f(y) = x) [−1, 1]

∀yR(x, f(y)) (−∞,−1)∀yR(f(x), f(y)) ∅

∀y∃z(R(y, z) ∧ f(z) = x) [−1, 1]

As a further example of definable sets we do an example with a directed graph. Weconsider L with one binary relation symbol R, and let X be the L-structure given byX = {a, b, c, d, e, f} and RX = {(a, b), (a, c), (a, d), (a, e), (a, f), (b, d), (c, e), (c, f)},the example from the end of the last section. As before, it is worth drawing a pictureof the directed graph. First consider the formula ρ(x) given by

∀yR(x, y).

This says ‘for every y, x points to y’. But in our graph, there is no x pointing to everyy (note that a doesn’t point to itself). So

ρ(X ) = ∅.

Let’s consider the formula φ(x) given by

∀y¬R(x, y).

So φ(x) says ‘for every y, ¬R(x, y)’, that is ‘for every y it is not the case that x pointsto y’, i.e. ‘x doesn’t point to anything’. So we have

φ(X ) = {x ∈ X : x doesn’t point to anything }.

Now looking at your picture, or considering the definition of RX , we see that

φ(X ) = {d, e, f}.

Next let us consider the formula ψ(x) given by

∃y∃z(y 6= z ∧R(x, y) ∧R(x, z)).

So ψ(x) says ‘there are y and z such that y 6= z and x points to y and x points to z’.That is, ψ(x) says ‘x points to at least two elements’. So

ψ(X ) = {x ∈ X : x points to at least two elements}

and so

ψ(X ) = {a, c}.

For some more examples, let L = L0 ∨ {c, d, f, g, R} where c and d are constantsymbols, f and g are binary function symbols and R is a binary relation symbol. LetM be the L-structure which has underlying set M = R, the set of real numbers,cM = 0, dM = 1, fM(x, y) = x+y, gM(x, y) = x·y and RM = {(x, y) ∈ R2 : x < y}.

For each of the following sentences of L we check whether it is true or false in M.

(i) ∀x∃yR(x, y)This is true in M. To see this, we translate the sentence. It says ‘For all

x ∈ R there is a y ∈ R such that x < y’. And this is true: given x, we couldtake y = x+ 1, say.

Page 47: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

47

(ii) ∃x∀yR(x, y)This is false in M. Why? Well, it says ‘there is an x ∈ R such that for all

y ∈ R we have x < y’, and this is clearly false: given any x we have x = x soit is not the case that x < x.

(iii) ∃y∀x(R(c, x)→ R(x, f(y, g(x, x))))This is true inM. Is says ‘there is a y ∈ R such that for all x ∈ R if 0 < x

then we have x < y + x2. This is true, with y = 1 say.(iv) ∀x∃y(R(y, c)→ R(g(y, g(x, x)), c))

This is true in M. It says ‘for all x ∈ R there exists y ∈ R such that(y < 0→ yx2 < 0)’. To see that it is true, no matter what x is we take y = 1.Then y < 0 is false, so the implication is true.

(v) ∀x∃y(R(y, d) ∧R(g(y, g(x, x)), x))This is false in M. It says ‘for all x ∈ R there is a y ∈ R such that (y < 1

and yx2 < x)’. To see that it is false, note that for x = 0, we have yx2 = x,no matter what y is, so the second conjunct will always be false for x = 0 andany y, hence the sentence is false in M.

Next we take some formulas with a free variable, φ(x), and write down the subsetφ(M) of M which φ defines in M.

(i) R(g(f(d, d), g(f(x, f(d, d)), f(f(d, d), x))), c)We have

φ(M) = {a ∈ R :M |= φ(a)}= {a ∈ R :M |= R(g(f(d, d), g(f(a, f(d, d)), f(f(d, d), a))), c)}= {a ∈ R : 2(a+ 2)2 < 0}.

But for any a ∈ R we have 2(a+ 2)2 > 0, so this set is the empty set ∅.(ii) ¬(x = c ∧ x 6= c)→ (¬R(g(x, x), x))

To see what set this define in M, first note that (x = c∧ x 6= c) translatesas ‘x = 0 and x 6= 0’. This is always false, so the negation of it is always true.For the formula to be true, we thus need the second part of the implicationto be true. So the set the formula defines is just the set of a ∈ R such thatM |= ψ(a), where ψ(x) is ¬R(g(x, x), x). So the set is the set of reals a suchthat a2 ≥ a, that is,

(−∞, 0] ∪ [1,∞).

(iii) (∃yR(g(y, y), y))→ (x = c ∧ x 6= c)Again, the (x = c ∧ x 6= c) is always false. So the set this defines will be

the set of x which make the first part false. But the first part ∃yR(g(y, y), y)is a sentence: x doesn’t occur (free) in it. And it is a sentence that is true inM, as it says ‘there is a y such that y2 < y’, which is true, for instance withy = 1/2. So this formula defines the empty set in M.

Page 48: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

48

15. Posets and equivalence relations and constructing models

A different situation is as follows. We are given a language L and some sentencesσ1, . . . , σl of L, and we try to find, if possible, an L-structure M such that M |= σifor each i (i.e. M |= σ1 ∧ · · ·σl.

(For some choices of σ this might be impossible. For instance, if σ1 is ∃x(x 6= x)then we won’t be able to find a model. )

Suppose that L = L0 ∨ {R} where R is a binary relation. Consider the followingthree L-sentences:

σ which is ∀xR(x, x)

ρ which is ∀x∀y∀z((R(x, y) ∧R(y, z))→ R(x, z))

τ which is ∀x∀y((R(x, y) ∧R(y, x))→ x = y).

Suppose that M is an L-structure. We say that RM is

• reflexive if M |= σ,• transitive if M |= ρ,• antisymmetric if M |= τ .

As an example, let us write down an L-structure M such that RM is reflexive andtransitive but not antisymmetric. So we need to give a set M and a subset RM of M2

such that M |= σ and M |= ρ but such that it is not the case that M |= τ . One wayis to let M = {a, b} be a two element set and then just put RM = M2. Clearly σ andρ are true here, but (a, b) ∈ RM and (b, a) ∈ RM, and a 6= b so τ is false in M.

As an exercise, find structures which model other combinations of these sentences,but not all three.

If RM is reflexive, transitive and antisymmetric, we say thatM is a partially orderedset (or poset). For instance, we could take as an example a set with three elements{a, b, c} and define RM = {(a, a), (b, b), (c, c)}, a rather trivial poset. Or we coulddefine RM, with the same M by RM = {(a, a), (b, b), (c, c), (a, b), (a, c)}. Or, forinstance we could take M = N and RM = {(m,n) ∈ N2 : m ≤ n}. And so on.

Now let θ be the L-sentence ∀x∀y(R(x, y) → R(y, x)). We call RM symmetricif M |= θ. And then if RM is reflexive, transitive and symmetric, we call RM anequivalence relation on M .

As en exercise, write down an L-structureM such that RM is an equivalence relationon M .

For a different kind of example let L = L0∨{f} where f is a unary function symbol.Can we find an L-structure M such that M is a model of

σ which is ∃x, y, z∀w(w = x ∨ w = y ∨ w = z)

ρ which is ∀x(x 6= f(x))

τ which is ∃x(x 6= f(f(x)))?

Let’s first study σ and try to see what is says, that is, when it will be true in a givenstructure. But in fact we could study the simple sentence

∃x∀w(w = x).

When is this true in a structure? We must have an element x such that all otherelements are x. I.e. our set M must have cardinality 1. What about

∃x∃y∀w(w = x ∨ w = y)?

Page 49: Propositional terms De nition 1.1. A propositional ... · 6 2. Valuations De nition 2.1. Fix a propositional language L, and the corresponding propo-sitional terms SL. A valuation

49

This says that there exist x and y such that every element is either x or y. I.e., our setM must have at most 2 elements (we don’t say x 6= y). Similarly, M |= σ if and onlyif M has at most three elements.

The other two are a bit easier: we just have to make sure fM doesn’t send anyelement to itself, and that there is some element x such that x 6= f(f(x)). Hereis an example, we can take M = {a, b, c}, a set with three elements, and definefM(a) = b, fM(b) = c and fM(c) = a. Can you find another example? What aboutan model with only two elements?


Recommended