Fall 98, CSE 468: Lecture 3 (Aug 31)


Classical Logic.

Propositional calculus

Syntax

Formulas are expressions built on

Meaning

The letters range on the set of boolean values B = {True, False} The connectives are functions on B. For instance: "p implies q" is the function (of p and q) which returns False when p is True and q is False, and True in all other cases.

Truth tables: a way to represent the meaning of each connective. The meaning (truth value) of more complex formulas can be derived by composing the truth tables.

Tautology: A formula which is True for all the possible truth values of the letters contained in it.

Examples:

There are variuos systems to derive tautologies (i.e. to prove that a certain formula is a tautology), but usually the simplest method is to use the truth tables.

First Order Logic

Syntax

Terms: expressions constructed on Atomic Formulas: Predicate symbols (p, q, r, ...) applied to terms

Example: x, 1, x+1 are terms. x+1 > 0 is an atomic formula. (1 is a constant, + is a function, and > is a predicate.)

Formulas: Expressions built on atomic formulas, the logical connectives, and the quantifiers exists and forall.

Meaning

The meaning (truth value) of a formula in F.O.L. depends upon: The choice of the domain plays a role also for the interpretation of the quantifiers. Example: The formula
forall x>0 exists y. x*y = 1
is True in the domain of rational numbers, but is False in the domain of integer numbers.

Valid formulas: formulas which are True in every domain, and for every possible interpretation of the function, constant, and predicate symbols.

In general the truth tables are not enough to prove that a fourmula is valid. There are various systems for this purpose; but anyway (for the purposes of the course) we will mostly rely on our intuition. All the laws of classical logic are pretty intuitive except maybe for the Law of the excluded middle:

p or not p
This law, which says that either p is True or its negation is True, brings to curious consequences like the following Smoker's Paradox:
There is a person is this room such that, if this person smokes, then everybody in the room smokes.
This sentence is true in classical logic (provided that the room is not empty). In fact we can formulate it as:
exists x. (smokes(x) -> forall y. smokes(y))
which is equivalent to
(exists x. not smokes(x)) or (forall y. smokes(y))
which is (classically) equivalent to
(not (forall x. smokes(x))) or (forall x. smokes(x))
Notably, the law of excluded middle is not accepted in other logics, like the Intuitionistic Logic. (We, however, will use it.)

Induction principle

The induction principle is useful to prove properties of the form
forall x. P(x)
where P is an arbritrary formula containing x, and the intended domain is the set of natural numbers.

The principle says that, in order to prove the above formula, it is sufficent to prove the following:

Exercise: prove by induction that

forall x. 1 + 2 + ... + x = x*(x+1)/2

The induction principle can trivially be generalized to start with a base case greater than 0.

Exercise: Find the mistake in the following reasoning, which proves (erroneously) that all people have the same height: