Technopedia

The technologist’s encyclopedia

Mathematical logic

Mathematical logic is the formal study of reasoning itself: it defines precise languages, precise notions of truth, and precise notions of proof, and then studies the relationship between truth and proof. It is the meta-discipline that underlies every other class of Logic and foundations.

Authoritative sources

Propositional and predicate logic

The starting point is a language: a set of symbols with a grammar for well-formed formulas (wffs). Propositional logic builds formulas from atomic propositions using connectives (∧\wedge and, ∨\vee or, ¬\neg not, →\to implication, ↔\leftrightarrow biconditional). Predicate (first-order) logic adds variables, function symbols, predicate symbols, and the quantifiers ∀\forall (for all) and ∃\exists (there exists), so formulas can talk about the internal structure of objects.

Details

Step 1 — Why formalize? Natural-language arguments are ambiguous: “some”, “and”, “if” shift meaning with context. A formal language removes the ambiguity. A formula is a finite string of symbols, and “provable” becomes a precise, mechanically checkable relation. This is the foundation every later section builds on.

Step 2 — Propositional connectives. Each connective has a fixed truth function. The truth table below lists the value of a compound formula for every assignment of truth values to its atoms. A formula true on every row is a tautology (valid); one false on every row is a contradiction.

PQ¬PP ∧ QP ∨ QP → Q
TTFTTT
TFFFTF
FTTFTT
FFTFFT

Note that P→QP \to Q is false only when PP is true and QQ is false — this is why “if it rains, the ground is wet” is not falsified by a dry day with no rain.

Step 3 — Quantifiers. First-order logic lets a formula bind variables. ∀x P(x)\forall x\, P(x) says every object satisfies PP; ∃x P(x)\exists x\, P(x) says at least one does. Quantifiers have scope (the formula they bind) and interact: ∀x ∃y R(x,y)\forall x\, \exists y\, R(x,y) (“everyone has a friend”) is not the same as ∃y ∀x R(x,y)\exists y\, \forall x\, R(x,y) (“there is one friend of everyone”).

Step 4 — From formulas to truth. A propositional formula is evaluated by a valuation (an assignment of T/F to atoms). A first-order formula is evaluated by a structure (the next section). This split — syntax (the formula) versus semantics (its truth) — is the axis the whole field turns on.

Authoritative sources

Example problem

Is (P→Q)∧(P→¬Q)(P \to Q) \wedge (P \to \neg Q) a contradiction?

Solution

Work through the truth table. The formula is true only when both implications hold. If PP is false, both implications are vacuously true, so the conjunction is true. If PP is true, then QQ and ¬Q\neg Q must both be true, which is impossible. So the formula is true exactly when PP is false — it is not a contradiction (it is satisfiable).

Formal systems

A formal system is a set of symbols, a grammar for well-formed formulas, a set of axioms, and inference rules. A proof is a finite sequence of formulas where each is an axiom or follows from earlier ones by an inference rule. Nothing in a formal proof depends on meaning: it is pure symbol manipulation, which is what makes proofs checkable by machine.

Details

Step 1 — The four ingredients. A formal system is fully specified by (i) an alphabet of symbols, (ii) a grammar deciding which strings are well-formed formulas, (iii) a set of axioms (wffs taken as true without proof), and (iv) inference rules (patterns that turn earlier formulas into new ones). For example, modus ponens is the rule: from AA and A→BA \to B infer BB.

Step 2 — A proof is a tree of rule applications. Each formula in a proof cites either an axiom or a rule applied to earlier lines. Because every step is a local, checkable pattern, a whole proof can be verified by a machine that never “understands” the content.

The parse tree of the wff (P∧(Q→R))(P \wedge (Q \to R)) shows how the grammar recursively builds a formula from its subformulas:

∧ P → Q R

The root is the outermost connective; leaves are the atomic propositions. The tree is what a parser produces and what a proof checker walks.

Step 3 — Provability is decidable. Given a formal system and a formula, “is there a proof of this formula?” is a well-defined question: enumerate all finite strings and check each for being a valid proof. This decidability of proof checking (as opposed to finding proofs) is what makes formal systems the substrate for machine-checked mathematics.

Authoritative sources

Example problem

In a system with axiom P→QP \to Q and rule modus ponens, is QQ provable from the single assumption PP?

Solution

Yes. Line 1: PP (assumption). Line 2: P→QP \to Q (axiom). Line 3: QQ (modus ponens on lines 1 and 2). A three-line proof exists, so QQ is provable.

Semantics and model theory

Model theory gives the formal language meaning. A structure (or model) interprets the symbols of a language over a set; a formula is satisfied by a structure when it is true under that interpretation. Three central results:

Details

Step 1 — What a structure is. A structure for a language L\mathcal{L} is a set DD (the domain) together with an interpretation of every symbol: each constant is an element of DD, each nn-ary function is a map Dn→DD^n \to D, each nn-ary predicate is a subset of DnD^n. The diagram below shows a structure with domain {a,b,c}\{a, b, c\}, a constant cc, a unary function ff, and a unary predicate PP:

domain D = {a, b, c} a b c f: a→b, b→c, c→a P = {a, c} (green = in P)

Here PP is true of aa and cc (green) and false of bb; the function ff cycles the three elements.

Step 2 — Satisfaction. A formula is satisfied by a structure (written M⊨φ\mathcal{M} \models \varphi) when it is true under the interpretation. Atomic facts are read off directly: M⊨P(a)\mathcal{M} \models P(a) because a∈Pa \in P. Compound formulas are evaluated recursively, and quantifiers range over the domain: M⊨∀x P(x)\mathcal{M} \models \forall x\, P(x) holds only if every element of DD is in PP — false here, since b∉Pb \notin P.

Step 3 — Completeness. Gödel’s completeness theorem says provability and universal truth coincide for first-order logic: Γ⊢φ\Gamma \vdash \varphi iff Γ⊨φ\Gamma \models \varphi. This is deep and non-obvious; for second-order logic the two notions diverge (there are valid second-order sentences with no effective proof).

Step 4 — Compactness and Löwenheim–Skolem. Compactness says truth is “local”: if every finite piece of a theory is satisfiable, so is the whole theory. Löwenheim–Skolem says first-order logic cannot fix the size of a model: any theory with an infinite model has models of every infinite cardinality. Together they explain why first-order logic cannot characterize the natural numbers up to isomorphism — non-standard, and arbitrarily large, models always exist.

Authoritative sources

Example problem

In the structure above, is ∃x (P(x)∧f(x)∉P)\exists x\, (P(x) \wedge f(x) \notin P) satisfied?

Solution

Check each element. f(a)=bf(a) = b and b∉Pb \notin P, while a∈Pa \in P. So x=ax = a witnesses the formula: P(a)P(a) holds and f(a)=bf(a) = b is not in PP. The formula is satisfied.

Proof theory

Proof theory studies proofs as mathematical objects. Its central technique is cut elimination (Gentzen): every proof using lemmas can be mechanically transformed into a direct, lemma-free proof. Consequences include consistency proofs (Gentzen proved the consistency of arithmetic using transfinite induction up to the ordinal ε0\varepsilon_0) and ordinal analysis, which measures the strength of a theory by the ordinal needed to prove its consistency.

Details

Step 1 — Proofs as objects. In proof theory a proof is a tree whose leaves are axioms and whose internal nodes are rule applications. The cut rule lets you reason through a lemma LL: from A⊢LA \vdash L and L⊢CL \vdash C infer A⊢CA \vdash C. Cuts make proofs short and readable, but they introduce an intermediate formula LL that is not forced by the conclusion.

Step 2 — Cut elimination. Gentzen’s theorem says every proof can be transformed, by a mechanical procedure, into an equivalent proof with no cuts. The animation below shows a proof that goes through a lemma LL (a cut) being rewritten into a direct proof that reaches CC without it:

Step 3 — Why it matters. Cut elimination yields the subformula property (only subformulas of the conclusion occur in the proof), which in turn gives consistency proofs: a consistent logic cannot prove a contradiction, because a cut-free proof of A∧¬AA \wedge \neg A would have to contain both AA and ¬A\neg A as subformulas of the conclusion in an impossible way. Gentzen used a transfinite version of this argument, indexed by ordinals below ε0\varepsilon_0, to prove the consistency of Peano arithmetic — a result that cannot be proved inside the system itself (by the second incompleteness theorem).

Authoritative sources

Example problem

A cut-free proof of P→QP \to Q in propositional logic may contain which formulas as subformulas?

Solution

By the subformula property, only subformulas of the conclusion P→QP \to Q may appear: namely P→QP \to Q, PP, and QQ. No other formula (for instance RR or P∧QP \wedge Q) can occur anywhere in a cut-free proof of P→QP \to Q.

Incompleteness

Gödel’s incompleteness theorems (1931) are the landmark results of the field:

  1. Any consistent, effectively axiomatized theory strong enough to express arithmetic is incomplete: some true statement in its language is unprovable.
  2. Such a theory cannot prove its own consistency.

The proofs use computability techniques (encoding statements about provability inside arithmetic itself) — see Computability and decidability for the machinery of arithmetization and the halting problem. The theorems are statements about formal systems, so they belong to Mathematical logic; the computability angle is the proof technique and the interpretive lens.

Details

Step 1 — Arithmetization. The key move is to encode syntax as arithmetic. Every formula and proof is assigned a natural number (its Gödel number), and “x is the Gödel number of a proof of y” becomes an ordinary, primitive-recursive relation on natural numbers. This is where the Computability and decidability machinery enters: provability is a computable (indeed decidable) relation.

The construction of the Gödel sentence proceeds in stages:

1. Arithmetization each formula φ gets a Gödel number ⌜φ⌝ ∈ ℕ 2. Provability predicate Prov_T(x): "x is the number of a T-proof of ⌜x⌝" — a formula of arithmetic 3. Diagonal lemma there is a sentence G with T ⊢ G ↔ ¬Prov_T(⌜G⌝) G says of itself: "G is not provable in T"

Step 2 — The Gödel sentence. The diagonal lemma guarantees a sentence GG such that the theory proves G↔¬ProvT(⌜G⌝)G \leftrightarrow \neg \mathrm{Prov}_T(\ulcorner G\urcorner) — that is, GG asserts its own unprovability. If TT proved GG, then ProvT(⌜G⌝)\mathrm{Prov}_T(\ulcorner G\urcorner) would be true, contradicting GG; so a consistent TT does not prove GG. But then ¬ProvT(⌜G⌝)\neg \mathrm{Prov}_T(\ulcorner G\urcorner) is true, so GG is true. Hence GG is true but unprovable: the first incompleteness theorem.

Step 3 — The second theorem. Let Con(T)\mathrm{Con}(T) be the arithmetical sentence asserting that no proof of a contradiction exists. If TT proved Con(T)\mathrm{Con}(T), one could build a sentence that is provable exactly when TT is inconsistent, and the first theorem applied to it would force TT to be inconsistent. So a consistent TT cannot prove its own consistency.

Step 4 — What it means in practice. Incompleteness does not make mathematics unusable: it bounds what any single fixed axiom system can capture, and it explains why proof assistants and set theorists sometimes need new axioms (such as large cardinals) to settle independent statements like the continuum hypothesis.

Authoritative sources

Example problem

Is the statement “this sentence is not provable in Peano Arithmetic” a well-formed arithmetic sentence?

Solution

Yes — Gödel’s arithmetization encodes provability as a primitive-recursive relation between formula numbers, so the sentence is an ordinary statement about natural numbers, which is what makes the construction work inside arithmetic.

Quizz

Try it yourself

Problem. A first-order theory TT has a model whose domain has exactly 5 elements. By which of the three central results of model theory (completeness, compactness, Löwenheim–Skolem) can you conclude that TT also has a model with infinitely many elements? State the reasoning in one or two sentences.

How to solve it

Use the Löwenheim–Skolem theorem. It says that if a first-order theory has an infinite model, it has models of every infinite cardinality — and, in its upward form, that any theory with a model has a model of any larger cardinality. Since TT has a 5-element model, the upward Löwenheim–Skolem theorem gives a model of TT with infinitely many elements. (Completeness and compactness do not by themselves control the size of models, so they are not the right tools here.)