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
- K. Gödel (1931), Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I
- Stanford Encyclopedia of Philosophy: Gödel’s Incompleteness Theorems
- Stanford Encyclopedia of Philosophy: Model Theory
- Stanford Encyclopedia of Philosophy: The Completeness Theorem
- Stanford Encyclopedia of Philosophy: The Compactness Theorem
- A. Tarski (1933), Der Wahrheitsbegriff in den formalisierten Sprachen
- G. Gentzen (1936), Über die Zulässigkeit der Cut-Elimination
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 ( and, or, not, implication, biconditional). Predicate (first-order) logic adds variables, function symbols, predicate symbols, and the quantifiers (for all) and (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.
| P | Q | ¬P | P ∧ Q | P ∨ Q | P → Q |
|---|---|---|---|---|---|
| T | T | F | T | T | T |
| T | F | F | F | T | F |
| F | T | T | F | T | T |
| F | F | T | F | F | T |
Note that is false only when is true and 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. says every object satisfies ; says at least one does. Quantifiers have scope (the formula they bind) and interact: (“everyone has a friend”) is not the same as (“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 a contradiction?
Solution
Work through the truth table. The formula is true only when both implications hold. If is false, both implications are vacuously true, so the conjunction is true. If is true, then and must both be true, which is impossible. So the formula is true exactly when 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 and infer .
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 shows how the grammar recursively builds a formula from its subformulas:
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 and rule modus ponens, is provable from the single assumption ?
Solution
Yes. Line 1: (assumption). Line 2: (axiom). Line 3: (modus ponens on lines 1 and 2). A three-line proof exists, so 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:
- Gödel’s completeness theorem: a formula is provable from a set of axioms if and only if it is true in every model of those axioms. Syntax and semantics coincide for first-order logic.
- Compactness theorem: if every finite subset of a set of axioms has a model, the whole set has a model. Consequence: first-order logic cannot pin down the natural numbers up to isomorphism (non-standard models exist).
- Löwenheim–Skolem theorem: if a first-order theory has an infinite model, it has models of every infinite cardinality. First-order logic cannot control the size of its models.
Details
Step 1 — What a structure is. A structure for a language is a set (the domain) together with an interpretation of every symbol: each constant is an element of , each -ary function is a map , each -ary predicate is a subset of . The diagram below shows a structure with domain , a constant , a unary function , and a unary predicate :
Here is true of and (green) and false of ; the function cycles the three elements.
Step 2 — Satisfaction. A formula is satisfied by a structure (written ) when it is true under the interpretation. Atomic facts are read off directly: because . Compound formulas are evaluated recursively, and quantifiers range over the domain: holds only if every element of is in — false here, since .
Step 3 — Completeness. Gödel’s completeness theorem says provability and universal truth coincide for first-order logic: iff . 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 satisfied?
Solution
Check each element. and , while . So witnesses the formula: holds and is not in . 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 ) 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 : from and infer . Cuts make proofs short and readable, but they introduce an intermediate formula 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 (a cut) being rewritten into a direct proof that reaches 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 would have to contain both and as subformulas of the conclusion in an impossible way. Gentzen used a transfinite version of this argument, indexed by ordinals below , 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 in propositional logic may contain which formulas as subformulas?
Solution
By the subformula property, only subformulas of the conclusion may appear: namely , , and . No other formula (for instance or ) can occur anywhere in a cut-free proof of .
Incompleteness §
Gödel’s incompleteness theorems (1931) are the landmark results of the field:
- Any consistent, effectively axiomatized theory strong enough to express arithmetic is incomplete: some true statement in its language is unprovable.
- 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:
Step 2 — The Gödel sentence. The diagonal lemma guarantees a sentence such that the theory proves — that is, asserts its own unprovability. If proved , then would be true, contradicting ; so a consistent does not prove . But then is true, so is true. Hence is true but unprovable: the first incompleteness theorem.
Step 3 — The second theorem. Let be the arithmetical sentence asserting that no proof of a contradiction exists. If proved , one could build a sentence that is provable exactly when is inconsistent, and the first theorem applied to it would force to be inconsistent. So a consistent 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 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 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 has a 5-element model, the upward Löwenheim–Skolem theorem gives a model of with infinitely many elements. (Completeness and compactness do not by themselves control the size of models, so they are not the right tools here.)