The Timpson Lyceum seal

The Timpson Lyceum · Computation Theory

Lecture 1 (Computation Theory) Propositional and Predicate Logic

Propositional and Predicate Logic – Lecture 1

Overview

This opening lecture lays the logical foundations the rest of computation theory is built on. It introduces propositional logic — the algebra of statements that are either true or false — and then extends to predicate logic, which adds variables and quantifiers. You will learn what propositions and predicates are, how logical operators are defined by truth tables, how to prove logical theorems (tautologies), and how the universal and existential quantifiers turn open predicates into definite propositions. The recurring theme is that logic studies the structure of reasoning: we can prove a statement follows from others without ever knowing what the underlying statements actually mean. These tools are essential later, when machines and the languages they recognize are defined through dense set-theoretic statements.

Key Concepts

Proposition — a statement (variable) whose value is either true or false, never both and never neither. Working with logic is like doing arithmetic with only two "numbers," TT and FF.

Tautology and contradiction — a tautology is a proposition that is always true; a contradiction is a proposition that is always false.

Theorem — a proposition that has been shown to be a tautology. Theorems are almost always stated as implications, so a theorem is often a tautological implication (an if–then statement that is always true).

Unary operators on propositions. Because there are only two truth values, there are exactly 22=42^2 = 4 possible unary operators (one output choice for each of the two inputs). The only one that matters in practice is negation (¬p\neg p): it returns the opposite truth value. (¬T=F\neg T = F, ¬F=T\neg F = T.)

Binary operators on propositions. There are exactly 24=162^4 = 16 possible binary operators (two output choices for each of the four input rows). The important ones:

Truth tables for the core operators:

α\alphaβ\betaα∧β\alpha \land \betaα∨β\alpha \lor \betaα→β\alpha \rightarrow \betaα↔β\alpha \leftrightarrow \beta
TTTTTT
TFFTFF
FTFTTF
FFFFTT

Key logical equivalences (proved by truth table):

NAND is functionally complete. Every logical operator can be built from NAND alone, which is why it is a "primitive" used when designing computer circuits (the arithmetic logic unit). For example ¬α≡α∣α\neg\alpha \equiv \alpha \mid \alpha, and α∧β≡(α∣β)∣(α∣β)\alpha \land \beta \equiv (\alpha \mid \beta) \mid (\alpha \mid \beta).

English readings of implication. "α\alpha if β\beta" means β→α\beta \rightarrow \alpha; "α\alpha only if β\beta" means α→β\alpha \rightarrow \beta. Combining both gives "α\alpha if and only if β\beta," written α↔β\alpha \leftrightarrow \beta.

Predicate — a proposition-valued function of one or more variables, e.g. P(x)P(x). By itself a predicate is neither true nor false; it becomes a proposition only once values are supplied. Example: "is blue" is a predicate; "the desk is blue" is a proposition.

Relation — a predicate of two variables, e.g. Q(x,y)Q(x,y). Relations are common enough (like << or ≤\le) to get a special name and infix notation: we write x<yx < y rather than <(x,y)<(x,y). Predicates can take any number of variables (three variables, etc.); only the two-variable case is called a relation.

Combining predicates. Since predicates ultimately yield truth values, logical operators combine them into new predicates, e.g. defining x≤yx \le y to mean (x=y)∨(x<y)(x = y) \lor (x < y).

Only propositions can be proved. To prove something means to show a proposition is a tautology. A predicate on its own cannot be proved or disproved — it has no fixed truth value.

Universal quantifier ∀\forall ("for all" / "for every"). For a predicate P(x)P(x), the statement ∀x P(x)\forall x\, P(x) is a proposition, true exactly when P(x)P(x) holds independent of the choice of xx. Example: ∀x (x>2)\forall x\,(x > 2) is false; ∀x (x≥x)\forall x\,(x \ge x) is true.

Existential quantifier ∃\exists ("there exists ... such that"), defined in terms of the universal quantifier: ∃x P(x)    ≡    ¬ ∀x ¬P(x).\exists x\, P(x) \;\;\equiv\;\; \neg\,\forall x\, \neg P(x). ∃x P(x)\exists x\, P(x) is true when at least one xx makes P(x)P(x) true. Read "∃x\exists x" as "there exists an xx such that."

Order of quantifiers matters when the quantifiers differ. For instance ∀x ∃y (x+y=0)\forall x\, \exists y\,(x + y = 0) is true (take y=−xy = -x), but ∃x ∀y (x+y=0)\exists x\, \forall y\,(x + y = 0) is false (no single xx works for every yy). Swapping two like quantifiers (∀∀\forall\forall or ∃∃\exists\exists) changes nothing.

Quantifier negation rule: ∀x P(x)  ↔  ¬ ∃x ¬P(x)\forall x\, P(x) \;\leftrightarrow\; \neg\,\exists x\,\neg P(x) ("all swans are white" says the same as "there is no non-white swan").

Unique existential quantifier ∃! x P(x)\exists!\,x\, P(x) ("there exists exactly one xx"): ∃! x P(x)    ≡    ∃x [P(x) ∧ ∀y ∀z ((P(y)∧P(z))→(y=z))].\exists!\,x\, P(x) \;\;\equiv\;\; \exists x\,\Big[P(x) \,\land\, \forall y\,\forall z\,\big((P(y) \land P(z)) \rightarrow (y = z)\big)\Big]. The first part says at least one xx works; the second says any two values that both work must actually be the same. Example: there is exactly one even prime, namely 22.

Worked Example

Prove the quantifier-negation theorem: for any predicate P(x)P(x), ∀x P(x)  ↔  ¬ ∃x ¬P(x).\forall x\, P(x) \;\leftrightarrow\; \neg\,\exists x\,\neg P(x).

Strategy: start from the right-hand side and reduce it to the left, using the definition of ∃\exists and double negation. Let Q(x):=¬P(x)Q(x) := \neg P(x), so that P(x)≡¬Q(x)P(x) \equiv \neg Q(x).

¬ ∃x ¬P(x)≡¬ ∃x Q(x)substitute Q(x)=¬P(x)≡¬ (¬ ∀x ¬Q(x))definition of ∃≡∀x ¬Q(x)double negation ¬¬=id≡∀x ¬¬P(x)Q(x)=¬P(x)≡∀x P(x)double negation\begin{aligned} \neg\,\exists x\,\neg P(x) &\equiv \neg\,\exists x\, Q(x) && \text{substitute } Q(x)=\neg P(x) \\ &\equiv \neg\,\big(\neg\,\forall x\, \neg Q(x)\big) && \text{definition of } \exists \\ &\equiv \forall x\, \neg Q(x) && \text{double negation } \neg\neg = \text{id} \\ &\equiv \forall x\, \neg\neg P(x) && Q(x)=\neg P(x) \\ &\equiv \forall x\, P(x) && \text{double negation} \end{aligned}

Since the two sides always evaluate to the same truth value, the biconditional is a tautology, so the statement is a theorem. In plain terms: "every xx has property PP" says exactly the same thing as "there is no xx lacking property PP."

Summary

Lecture 1 (Computation Theory) Propositional and Predicate Logic — Notes · The Timpson Lyceum