Chapter 1
Chapter 1
Chapter 1
i=1
(n i) + 1 = n
2
+n (1/2)n(n + 1) = 1/2(n + 1)n
block-subsequences of s.
Denition 1.7 (1) A sequence a
1
, . . . , a
k
is an initial segment of another se-
quence b
1
, . . . , b
m
if and only if k is less than or equal to m and for all i k,
a
i
= b
i
. In other words, b
1
, . . . , b
m
is equal to a
1
, . . . , a
k
+b
k+1
, . . . , b
m
,
where b
k+1
, . . . , b
m
could be the empty sequence.
(2) When m is greater than k, we say that a
1
, . . . , a
k
is a proper initial segment
of a
1
, . . . , a
k
, b
k+1
, . . . , b
m
.
Denition 1.8 Suppose that is a formula. A formula is a subformula of
if is a block-subsequence of .
The subformulas of are precisely the formulas which arise in the denition
of .
Denition 1.9 Suppose that
= a
1
, . . . , a
n
is a formula.
Suppose s is a nite sequence. An occurrence of s in is an interval
[j
1
, j
2
]
such that s = a
j1
, . . . , a
j2
.
Remark 1.10 Suppose that is a formula. A formula is a subformula of
if and only if has an occurrence in .
Lemma 1.11 (Readability) Suppose that is a formula in L
0
. Then exactly
one of the following conditions applies.
(1) There is an n such that = A
n
.
(2) There is a L
0
such that = ().
(3) There are
1
and
2
in L
0
such that = (
1
2
).
Proof. Consider the subset L of L
0
which consists of those formulas which sat-
isfy the above three clauses. By the rst clause, if n N, then A
n
L. Con-
sequently, L satises Condition 1 of Denition 1.3. Secondly, if is in L, then
L
0
and so () L
0
. But then () is an element of L
0
which satises the
4 Propositional logic
second of the above clauses, and hence () L. Similarly, if
1
and
2
belong
to L, then so does (
1
2
). Thus, L satises Condition 2 of Denition 1.3. It
follows that L
0
L, and so L
0
= L.
It remains to show that the three possibilities are mutually exclusive.
Clearly, the rst case excludes the other two since both of the formulas in
the latter two cases begin with the symbol (. Now, if = (), then the second
symbol in is . However, if = (
1
2
), then the second symbol in is the
rst symbol in
1
, which by the above is either an A
n
or (. Consequently, these
two cases are mutually exclusive. .
We now prove a technical lemma which we will apply to show that the sub-
formulas of mentioned above are uniquely determined.
Lemma 1.12 If L
0
, then no proper initial segment of is an element of
L
0
.
Proof. We prove Lemma 1.12 by induction on n.
If has length 1 then the only subsequence to be considered is the empty
sequence, which by Lemma 1.11 is not an element of L
0
.
Now suppose that L
0
has length n, n > 1, and Lemma 1.12 holds for all
m less than n. By Lemma 1.11, since has length greater than 1, has one of
two forms: () or (
1
2
).
Suppose that is (). For a contradiction, suppose that L
0
is a proper
initial segment of (). Then the rst symbol in is (, so is not of the formA
i
,
and by Lemma 1.11 the length of is greater than one. Thus, the second symbol
in is , which by Lemma 1.11 is not the rst symbol of any element of L
0
, and
so cannot be of the form (
1
2
). Consequently, there is a
1
L
0
such that
is equal to (
1
). But then () has (
1
) as a proper initial segment, and so
has
1
as a proper initial segment, contradiction to the induction hypothesis.
Finally, suppose that is (
1
2
) and that L
0
is a proper initial
segment of . We can apply Lemma 1.11 and argue as in the previous paragraph
that there are
1
and
2
in L
0
such that = (
1
2
). But then either
1
is
a proper initial segment of
1
(a contradiction),
1
is a proper initial segment
of
1
(a contradiction), or
1
=
1
and
2
is a proper initial segment of
2
(a
contradiction).
In either case, has no proper initial segment in L
0
. .
Theorem 1.13 (Unique Readability) Suppose that is a formula in L
0
.
Then exactly one of the following conditions applies.
(1) There is an n such that = A
n
.
(2) There is a L
0
such that = ().
(3) There are
1
and
2
in L
0
such that = (
1
2
).
Further, in cases (2) and (3), the formulas , and
1
and
2
are unique, respec-
tively.
Truth assignments 5
Proof. By Lemma 1.11, it is enough to check the claim of uniqueness.
First, suppose that = () and = (). Thus, the sequence of symbols
can be read as (, + + ) and as (, + + ). The occurrences of
and within have the same length and the same elements, and therefore are
equal.
Finally, suppose that = (
1
2
) and = (
1
2
). Since both
1
and
1
belong to L
0
, by Lemma 1.12 neither can be a proper initial segment of the
other. Since they are initial segments of each other, they must be equal. As in
the case of negation, it follows that
2
and
2
are also equal. .
1.1.2 Exercises
(1) Give three examples of elements of L
0
with at least 15 symbols each. The
examples should have an interesting structure. For one of these examples,
give a meaningful sentence which has the same structure.
(2) For which natural numbers n are there elements of L
0
of length n?
(3) Show that a sequence is an element of L
0
if and only if there is a nite
sequence of sequences
1
, . . . ,
n
such that
n
= , and for each if i less
than or equal to n either there is an m such that
i
= A
m
, or there is a j
less than i such that
i
is equal to (
j
), or there are j
1
and j
2
less than i
such that
i
is equal to (
j1
j2
).
(4) Give an algorithm (suitable to be programmed for a computer) to determine
whether a given nite sequence belongs to L
0
.
(5) Consider the set of symbols and #. Let L
2
= +
1
+
2
.
State and prove the unique readability theorem for T
0
. Note, the Polish
system of notation does away with parentheses.
1.2 Truth assignments
We can now describe the semantics for propositional logic.
Denition 1.14 A truth assignment for L
0
is a function from the set of
propositional symbols A
n
: n N into the set T, F.
Now, () should have the opposite truth value from that of and the truth
value of (
1
2
) should reect whether, if
1
has truth value T, then
2
has
truth value T.
6 Propositional logic
Theorem 1.15 Suppose that is a truth assignment for L
0
. Then there is a
unique function dened on L
0
with the following properties.
(1) For all n, (A
n
) = (A
n
).
(2) For all L
0
,
(()) =
T, if () = F;
F, otherwise.
(3) For all
1
and
2
in L
0
,
((
1
2
)) =
F, if (
1
) = T and (
2
) = F;
T, otherwise.
Proof. We can dene by recursion on the natural numbers greater than or
equal to 1. During the s + 1st step of the recursion, we may assume that is
already dened on all elements of L
0
which have length less than or equal to s.
Base step. For each n N, dene (A
n
) = (A
n
).
Recursion step. Suppose that s 1, that is dened on all sequences from
L
0
of length less than or equal to s, and that is an element of L
0
of
length s + 1.
If = (), we dene () as in (2); if = (
1
2
), we dene ()
as in (3).
It remains to show that is well dened on L
0
, it satises (1), (2), and (3),
and that it is the unique such functionexistence and uniqueness.
We will prove the rst two claims (existence) by induction on the natural
numbers greater than or equal to 1.
Clearly, is well dened on the elements of L
0
of length 1 and satises (1).
Suppose that s 1 and, by induction, that is well dened on the set of
elements of L
0
of length less than or equal to s. Suppose that L
0
and has
length s + 1. By the Unique Readability Theorem 1.13, either there is a L
0
such that = (), or there are
1
and
2
such that = (
1
2
), the
two cases are mutually exclusive, and, in either case, the subformulas of which
appear in the way described are unique. Thus, the condition to dene () is
unambiguous, showing that is well dened at . Further, is dened at so
as to satisfy whichever of (2) or (3) is relevant.
By induction, is well dened on L
0
and satises (1), (2), and (3).
Now, we verify uniqueness. Suppose that
: L
0
T, F and satises (1),
(2), and (3). For the sake of a contradiction, suppose that
is not equal to .
Fix so that
() ,= ().
Since
(A
n
) = (A
n
). By denition,
(
A
n
) = (A
n
). Hence, for every n,
(A
n
) = (A
n
).
Consequently, the length of must be greater than 1. By the Unique Read-
ability Theorem 1.13, is either a negation () or an implication (
1
2
)
Truth assignments 7
and uniquely so. In the rst case, since
satises (2),
() = (). By denition,
(()) has the opposite value from (). It follows that
1
,
2
, . . . ,
i1
.
c) The last element of the list is .
(2) Letting k be the number of subformulas of of the form A
m
, we consider
all of the 2
k
possible truth assignments for their propositional symbols. We
use a row in the table for each such truth assignment , and we ll in the
cell below A
m
in that row with the value of at A
m
.
(3) Finally, we work our way across each row and ll in the values of at
i
as
determined by the values already lled in for its subformulas.
We give another example in Figure 1.3. This time we have chosen the tau-
tology expressing the principle that if A
1
implies A
2
, then the contrapositive
implication from (A
2
) to (A
1
) also holds.
A
1
A
2
(A
1
A
2
) (A
1
) (A
2
) ((A
2
) (A
1
))
((A
1
A
2
)
((A
2
) (A
1
)))
T T T F F T T
T F F F T F T
F T T T F T T
F F T T T T T
Fig. 1.3 The truth table for ((A1 A2) ((A2) (A1)))
Theorem 1.18 There are algorithms to determine whether a propositional for-
mula is a tautology, satisable, or a contradiction.
Proof. Starting with a formula , we can systematically generate its truth table.
Then is a tautology if and only if every entry in the last column of its truth
table is equal to T. It is satisable if and only if there is an entry in the last
column of its truth table which is equal to T. It is a contradiction if and only if
every entry in the last column of its truth table is equal to F.
Remark 1.19 Roughly speaking, if has n many symbols, then the analysis of
by the method of truth tables involves 2
n
many steps. A question which has
received a considerable amount of attention is whether there is a more ecient
method which when given determines whether is satisable. For more infor-
mation on this problem, known as the P = NP problem, and even a cash prize,
see the following web site.
http://www.claymath.org/millennium/P vs NP/
Truth assignments 9
1.2.1 Truth functions
Denition 1.20 An n-place truth function is a function whose domain is the
set of sequences of Ts and Fs of length n, written T, F
n
and whose range is
contained in T, F.
If is a formula in L
0
and the propositional symbols which occur in
are contained in the set A
0
, . . . , A
n1
, then we can dene the truth function
f
() to be ().
In the next theorem, we show that L
0
is as expressive as is possible. By this,
we mean that every truth function is represented by a formula in L
0
.
Theorem 1.21 Suppose that f : T, F
n
T, F is a truth function. Then
there is a formula such that f
= f.
Proof. We build up to the formula by a sequence of smaller steps.
For T, F
n
, dene
,i
so that
,i
=
A
i1
, if (i) = T;
(A
i1
), if (i) = F.
Given two formulas
1
and
2
, we dene the conjunction of
1
and
2
to
be the formula ((
1
(
2
))). As is seen in Figure 1.2.1, a truth assignment
satises the conjunction of
1
and
2
if and only if it satises both
1
and
2
.
1
2
(
2
) (
1
(
2
)) ((
1
(
2
)))
T T F F T
T F T T F
F T F T F
F F T T F
Fig. 1.4 The conjunction of 1 and 2.
Given more than two formulas
1
, . . . ,
n
, we use recursion and dene their
conjunction to be the conjunction of
1
with the conjunction of
2
, . . . ,
n
. For
example, the conjunction of
1
,
2
, and
3
is the formula
((
1
(((
2
(
3
)))))).
By induction, if is a truth assignment, then maps the conjunction of
1
, . . . ,
n
to T if and only if maps each of
1
, . . . ,
n
to T.
For T, F
n
, we let
1
2
(
1
) ((
1
)
2
)
T T F T
T F F T
F T T T
F F T F
Fig. 1.5 The disjunction of 1 and 2.
the conjunction of
1
and
2
if and only if it satises at least one of
1
or
2
. As
above, when n is greater than two, we dene the disjunction of
1
, . . . ,
n
to be
the disjunction of
1
with the disjunction of
2
, . . . ,
n
. By another induction,
if is a truth assignment, then maps the disjunction of
1
, . . . ,
n
to T if and
only if it maps at least one of
1
, . . . ,
n
to T.
Now we let
f
be the disjunction of the set of formulas
f
, as required. .
Remark 1.22 It is not unusual to include symbols for conjunction, for
disjunction, and for if and only if. By Theorem 1.21, these and all other
logical connectives can be expressed in the language with only and .
Of course, the fewer symbols there are in the language, the fewer the number
of cases there are in proofs by induction, so we decided in favor a small number
of logical symbols. Occasionally, we pay a price for that decision: for example,
with the lengths of the formulas that appeared in the proof of Theorem 1.21.
Remark 1.23 In some applications, it important to the best possible represen-
tative of a truth function f. Best possible could mean having the shortest length
or having the fewest logical connectives of a certain type. When n is large, it is
computationally prohibitive to generate the truth tables for all of the possible
formulas with the desired functionality. Finding the optimal for a specied f
remains an interesting problem.
1.3 A proof system for L
0
Suppose that is a subset of L
0
so that is a set of propositional formulas. We
shall dene a formal notion of proof. Intuitively a proof from will be a nite
sequence,
1
, . . . ,
n
j2
= (
j1
i
).
(2) if and only if there exists a nite sequence
s =
1
, . . . ,
n
1
, . . . ,
n
2
,
(
1
2
).
Therefore, again by Corollary 1.33, (
1
2
) .
To nish, we suppose that
1
and
2
/ . Now we must show that
(
1
2
) / .
Since
2
/ , by Corollary 1.33, (
2
) .
16 Propositional logic
Thus
1
and (
2
). But
(
1
((
2
) ((
1
2
)))),
since (
1
((
2
) ((
1
2
)))) is a logical axiom. Therefore by the
Inference Lemma,
((
2
) ((
1
2
))),
and by the Inference Lemma once again,
((
1
2
)).
Finally by Corollary 1.33, ((
1
2
)) and so (
1
2
) / as required.
This completes the proof of the lemma. .
Our goal is to show that if is consistent then is satisable. We rst
consider the special case that is maximally consistent. This case will turn out
to be an easy case for uniquely species the truth assignment which witnesses
that is satisable.
Lemma 1.35 Suppose that L
0
and that is maximally consistent.
Then is satisable.
Proof. Dene a truth assignment as follows. For each i N, let
(A
i
) =
T, if A
i
;
F, if A
i
/ .
We claim that for each formula , () = T if and () = F if / .
We organize our proof of this claim by induction on the length of .
The case that has length 1 is immediate.
Suppose that has length n > 1 and that as induction hypothesis, for all
formulas if has length less than n then () = T if and () = F if
/ .
There are two cases.
Case 1: = (). Since is maximally consistent, if and only if / .
But () = T if and only if () = F. By the induction hypothesis () = T if
and only if .
Thus if then () = T and () = F if / .
Case 2: = (
1
2
). Since is maximally consistent, if and only if
at least one of
1
/ or
2
. This is by Lemma 1.34.
By the denition of , () = T if and only if either (
1
) = F or (
2
) = T.
Therefore by the induction hypothesis, () = T if and only if either
1
/ of
2
.
Thus, () = T if and only if .
This completes the induction. .
A proof system for L
0
17
Theorem 1.36 Suppose that L
0
and that is consistent.
Then there exists a set
L
0
such that
is maximally consistent.
Proof. Let (
i
: i N) be an enumeration of all of the formulas of L
0
. For
example, we could enumerate the nitely many length 1 formulas which use
only the propositional symbol A
1
; then, we could enumerate the nitely many
formulas of length less than or equal to 2 which use no propositional symbols
other than A
1
and A
2
; and in subsequent steps, enumerate the nitely many n
formulas of length less than or equal to n which use no propositional symbols
other than A
1
, . . . , A
n
.
We construct a sequence of sets (
n
: m N) by recursion on n. To begin,
let
0
equal . Given
n
, let
n+1
be dened as follows.
n+1
=
n
n
, if
n
n
is consistent;
n
n
, otherwise.
We check by induction that each
n
is consistent. Clearly,
0
is consistent, since
we are given that is consistent. Assuming that
n
is consistent, we can apply
Lemma 1.32 to conclude that at least one of
n
n
or
n
n
is also
consistent. But then,
n+1
is also consistent.
Now, dene
so that
=
nN
n
.
For the sake of a contradiction, suppose that
F
from
F
must be a subset of some
n
, and so one of the
n
s must be
inconsistent. Since we have already checked that all of the
n
s are consistent,
this is impossible. Thus
is consistent.
, either
or ()