Compactness Theorem (FOL)
Statement
Let be a first-order language and an -theory (a set of -sentences). Then:
Visualization
Define = "there exist at least distinct elements" (for each ):
Consider .
Finite subset Satisfying model
----------- ---------------
{Φ₁} Any nonempty set, e.g. {a}
{Φ₁, Φ₂} Any set with ≥ 2 elements, e.g. {a, b}
{Φ₁, Φ₂, Φ₃} Any set with ≥ 3 elements, e.g. {a, b, c}
{Φ₁, …, Φ_n} Any set with ≥ n elements
Every finite subset is satisfied by a set of size . By compactness, the full theory is satisfiable — and any model must be infinite. This gives a purely logical proof that "infinite" is not first-order definable by a finite set of axioms.
Proof Sketch
The Mathlib proof uses an ultraproduct construction:
- For each finite , let be a model of .
- Form the product and choose a non-principal ultrafilter on the directed set of finite subsets.
- The ultraproduct satisfies every sentence : for , all large enough contain , so almost-all satisfy , so the ultraproduct does by Łoś's theorem.
Connections
Compactness is one of the two central meta-theorems of first-order logic (the other is Gödel's Completeness TheoremGödel's Completeness TheoremA first-order sentence is provable from a theory iff it holds in every model of that theory.Read more →). Together they entail that syntactic provability and semantic truth coincide. The Löwenheim–Skolem TheoremLöwenheim–Skolem TheoremA first-order theory with an infinite model has models of every infinite cardinality.Read more → is a standard corollary: a theory with an infinite model has models of every infinite cardinality.
Lean4 Proof
import Mathlib.ModelTheory.Satisfiability
open FirstOrder Language Theory
/-- The Compactness Theorem: a first-order theory is satisfiable iff finitely satisfiable.
Mathlib: `FirstOrder.Language.Theory.isSatisfiable_iff_isFinitelySatisfiable`. -/
theorem fol_compactness {L : Language} {T : L.Theory} :
T.IsSatisfiable ↔ T.IsFinitelySatisfiable :=
isSatisfiable_iff_isFinitelySatisfiableReferenced by
- Gödel's Incompleteness TheoremsSet Theory and Logic
- Gödel's Completeness TheoremSet Theory and Logic
- Löwenheim–Skolem TheoremSet Theory and Logic
- Löwenheim–Skolem TheoremSet Theory and Logic