Prerequisites. Direct starred prerequisites: none. No later core chapter depends on this route.
Curry–Howard type theories identify a proposition with a type of its proofs. HOL does something deliberately different. It uses the simply typed lambda calculus as a language of mathematical objects, reserves one type for truth values, and puts proofs behind an abstract theorem interface. Classical reasoning, extensionality, and choice are principles of that logic; a theorem is not definitionally a program of its proposition, as it is in the propositions-as-types reading of chapter 2. The control-operator account of classical proofs in chapter 17 is another system, not an operational semantics for this HOL kernel.
This chapter fixes one HOL family member closely enough to prove things about it. The logical core is a compact Church-style presentation of the HOL rules documented by Gordon and in the HOL4 teaching packet [Gor85, Tue19]; slides 29–36 of the latter display the selected kernel. The definition principles and model follow the machine-checked account of Kumar, Arthan, Myreen, and Owens [KAMO14]. Historical LCF supplies the kernel architecture [Mil79]. Other HOL implementations make different small choices, so every theorem below is scoped to this frozen core.
The Church signature
Types and terms are 𝜏,𝜎::=𝛼∣𝖻𝗈𝗈𝗅∣𝗂𝗇𝖽∣𝜏→𝜎,𝑡,𝑢::=𝑥𝜏∣𝑐𝜏∣𝑡𝑢∣𝜆𝑥𝜏.𝑡. Type variables are schematic. The type operator → associates to the right, and application to the left. Every type is inhabited. A term of type 𝖻𝗈𝗈𝗅 is a formula; a sequent Γ ⊢𝑝 has a finite set of Boolean assumptions and a Boolean conclusion.
The primitive logical constants are polymorphic equality and choice: (=)𝛼:𝛼→𝛼→𝖻𝗈𝗈𝗅,(@)𝛼:(𝛼→𝖻𝗈𝗈𝗅)→𝛼. Truth, connectives, and quantifiers are definitions. One convenient basis is ⊤:=(𝜆𝑥.𝑥)=(𝜆𝑥.𝑥),𝑝∧𝑞:=(𝜆𝑓.𝑓𝑝𝑞)=(𝜆𝑓.𝑓⊤⊤),∀𝑥.𝑃𝑥:=𝑃=(𝜆𝑥.⊤). Negation, disjunction, implication, and existential quantification can then be defined classically. These encodings are not intended as a pleasant surface syntax. They show that equality plus the lambda calculus is a complete logical basis.
The primitive inference rules are as follows. Substitutions in INST are capture-avoiding simultaneous term substitutions; those in INST-TYPE substitute types throughout a theorem. 𝑋⊢𝑡=𝑡REFL Γ⊢𝑠=𝑡Δ⊢𝑡=𝑢Γ∪Δ⊢𝑠=𝑢TRANS Γ⊢𝑓=𝑔Δ⊢𝑥=𝑦Γ∪Δ⊢𝑓𝑥=𝑔𝑦COMB Γ⊢𝑠=𝑡𝑥∉FV(Γ)Γ⊢(𝜆𝑥.𝑠)=(𝜆𝑥.𝑡)ABS𝑋⊢(𝜆𝑥.𝑡)𝑥=𝑡BETA General beta conversion at an argument 𝑢 is derived by first choosing the bound variable fresh and then applying INST. 𝑋{𝑝}⊢𝑝ASSUMEΓ⊢𝑝=𝑞Δ⊢𝑝Γ∪Δ⊢𝑞EQ−MP Γ⊢𝑝Δ⊢𝑞(Γ∖{𝑞})∪(Δ∖{𝑝})⊢𝑝=𝑞DEDUCT−ANTISYM Γ⊢𝑝𝜃Γ⊢𝜃𝑝INST Γ⊢𝑝𝜌Γ⊢𝜌𝑝INST−TYPE. In DEDUCT-ANTISYM, the first premise is understood to use 𝑞 as a possible assumption and the second to use 𝑝. Writing the set differences in the conclusion makes assumption discharge explicit.
Three closed axioms complete the selected signature: 𝖤𝖳𝖠:⊢(𝜆𝑥.𝑓𝑥)=𝑓(𝑥∉FV(𝑓)), 𝖲𝖤𝖫𝖤𝖢𝖳:⊢𝑃𝑥⇒𝑃(@𝑃), 𝖨𝖭𝖥𝖨𝖭𝖨𝖳𝖸:⊢∃𝑓:𝗂𝗇𝖽→𝗂𝗇𝖽.𝗂𝗇𝗃(𝑓)∧¬𝗌𝗎𝗋𝗃(𝑓). The last formula is one common infinity axiom; equivalent HOL presentations may instead postulate an injective non-surjective successor directly.
Which principles enter where?
The following ledger prevents several common conflations. Beta is a primitive inference rule, justified by function application. Eta is a closed axiom, valid because functions are extensional. Propositional extensionality and classical logic are derived theorems of the Boolean encoding, whose model interprets 𝖻𝗈𝗈𝗅 by exactly {0,1}. Choice is a closed axiom using @, interpreted by a choice function on every nonempty type. Infinity is a closed axiom, interpreted by choosing 𝗂𝗇𝖽 infinite. Equality is primitive at every type. Functional extensionality follows from 𝜂 and congruence. Propositional extensionality is stronger than merely having equality at 𝖻𝗈𝗈𝗅: the Boolean encoding proves that logically equivalent formulas denote the same Boolean. Classical excluded middle is a theorem of this logical basis, not a normalization consequence of the term calculus.
★★☆ Using 𝖤𝖳𝖠, ABS, COMB, and transitivity, derive ⊢(∀𝑥.𝑓 𝑥 =𝑔 𝑥) ⇒𝑓 =𝑔. Mark the single step that depends on the definition of ∀, rather than on a kernel rule. (Twelve lines.)
Referenced from 3 locations
A set model
Fix a set-theoretic universe containing a two-element set and a countably infinite set. A valuation 𝜈 assigns every type variable a nonempty set. Interpret types by [[𝖻𝗈𝗈𝗅]]𝜈={0,1},[[𝗂𝗇𝖽]]𝜈=ℕ,[[𝜎→𝜏]]𝜈=[[𝜏]][[𝜎]]𝜈𝜈. Constants receive elements of their denoted sets. Application and abstraction are interpreted by application and set-theoretic function formation. Equality denotes the diagonal characteristic function.
Because every type denotes a nonempty set, fix a global choice operation 𝜒𝑋 :(𝑋 →{0,1}) →𝑋 with (∃𝑥∈𝑋.𝑃(𝑥)=1)⟹𝑃(𝜒𝑋(𝑃))=1. Interpret (@)𝜏 by 𝜒[[𝜏]]. This is the semantic strength used by 𝖲𝖤𝖫𝖤𝖢𝖳; it is not smuggled into the lambda-calculus clauses. Interpret 𝗂𝗇𝖽 by ℕ, with successor witnessing 𝖨𝖭𝖥𝖨𝖭𝖨𝖳𝖸.
For a well-typed term 𝑡, term substitution 𝜃, environment 𝜂, and compatible type valuation 𝜈, [[𝜃𝑡]]𝜈,𝜂=[[𝑡]]𝜈,𝜂𝜃,𝜂𝜃(𝑥)=[[𝜃𝑥]]𝜈,𝜂. Type substitution satisfies the same equation after reindexing 𝜈.
Referenced from 3 locations
Proof of Lemma 65.1 — Semantic substitution
Proof. Induct on 𝑡. Variables are the definition of 𝜂𝜃; constants are fixed by the interpretation. Application uses the two induction hypotheses. For abstraction, rename its binder fresh for 𝜃, apply the induction hypothesis to the body in an extended environment, and use extensional equality of set-theoretic functions. ◻
Write (𝜈,𝜂) ⊧Γ when every member of Γ denotes 1, and Γ ⊧𝖺𝗅𝗅𝑝 when this implies [[𝑝]]𝜈,𝜂 =1 for every valuation and environment.
If Γ ⊢𝑝 is built from the rules and axioms above, then Γ ⊧𝖺𝗅𝗅𝑝.
Referenced from 3 locations
Proof of Theorem 65.2 — Kernel soundness
Proof. Induct on the theorem object. REFL, TRANS, and COMB are reflexivity, transitivity, and congruence of set equality. ABS uses function extensionality; its freshness condition keeps the assumption interpretations fixed. BETA is the semantic substitution lemma. For ASSUME, satisfaction of {𝑝} gives [[𝑝]] =1. Rule EQ-MP replaces equal Boolean values. For DEDUCT-ANTISYM, inspect the four possible truth-value pairs for 𝑝,𝑞: the premises exclude (1,0) and (0,1) under the undischarged assumptions, hence the values agree. The substitution rules use lemma 65.1. Finally 𝖤𝖳𝖠 holds for functions, 𝖲𝖤𝖫𝖤𝖢𝖳 by 𝜒, and 𝖨𝖭𝖥𝖨𝖭𝖨𝖳𝖸 in ℕ. ◻
There is no kernel derivation of ⊢⊥, where ⊥ is the defined false Boolean.
Proof of Corollary 65.3
Proof. The model gives [[⊥]] =0. Soundness would give value 1 to any closed theorem. ◻
This is a relative consistency argument in the stated set theory. It neither proves that an arbitrary implementation is bug-free nor covers later oracle axioms. Kumar et al. prove a corresponding soundness and consistency theorem for their formal HOL semantics [KAMO14].
★★☆ Write the missing semantic cases for abstraction and deduction antisymmetry. Give a countermodel after deleting abstraction’s freshness condition, and enumerate the Boolean pairs excluded by deduction antisymmetry. (Half a page.)
Referenced from 3 locations
Definitions, new types, and quotients
A constant definition introduces fresh 𝑐 :𝜏 with equation ⊢𝑐 =𝑡, where 𝑡 :𝜏 is closed and contains no type variable absent from 𝜏. Its model interpretation is forced to be [[𝑡]], so it creates notation, not a new axiom about old constants.
A type definition starts with an old-type predicate 𝑃 :𝜎 →𝖻𝗈𝗈𝗅 and a theorem ⊢∃𝑥.𝑃 𝑥. It introduces fresh 𝛼, 𝖺𝖻𝗌 :𝜎 →𝛼, and 𝗋𝖾𝗉 :𝛼 →𝜎, with characteristic equations ⊢𝖺𝖻𝗌(𝗋𝖾𝗉𝑎)=𝑎,⊢𝑃𝑟⟺𝗋𝖾𝗉(𝖺𝖻𝗌𝑟)=𝑟. Semantically, take [[𝛼]] ={𝑥 ∈[[𝜎]] ∣𝑃(𝑥) =1}. Nonemptiness is exactly what HOL’s inhabited-type discipline needs. Let 𝗋𝖾𝗉 be inclusion and let 𝖺𝖻𝗌 map members to themselves and nonmembers to one fixed witness. The equations follow. Extending every old model in this way proves conservativity for formulas in the old signature.
For a concrete quotient, let 𝖫𝗂𝗌𝗍(𝐴) be an already defined HOL type and put 𝑥𝑠≈𝑦𝑠⟺∀𝑎:𝐴.𝖼𝗈𝗎𝗇𝗍(𝑎,𝑥𝑠)=𝖼𝗈𝗎𝗇𝗍(𝑎,𝑦𝑠). This is an equivalence relation, and concatenation respects it: 𝑥𝑠≈𝑥𝑠′∧𝑦𝑠≈𝑦𝑠′⟹𝑥𝑠++𝑦𝑠≈𝑥𝑠′++𝑦𝑠′. A quotient package first constructs a nonempty representation of equivalence classes, then uses the type-definition principle to introduce 𝖡𝖺𝗀(𝐴). Lift [] and ( + +) to ∅ and ⊎. The representative equations give 𝐵⊎∅=𝐵,(𝐴⊎𝐵)⊎𝐶=𝐴⊎(𝐵⊎𝐶),𝐴⊎𝐵=𝐵⊎𝐴. Only the last law is new relative to lists; its proof is pointwise commutativity of natural-number addition. The package automates respectfulness and lifting, but its theorems still pass through the same kernel.
★★★ Prove transitivity of ≈, prove concatenation respectful, and derive commutativity of ⊎ by applying 𝗋𝖾𝗉 and comparing counts. List exactly where nonemptiness of the quotient representation is used. (One page.)
Referenced from 3 locations
The LCF trust boundary
An LCF implementation makes the host-language type 𝗍𝗁𝗆 abstract. Only kernel functions construct values of that type. A tactic has shape 𝗀𝗈𝖺𝗅⟶(𝗀𝗈𝖺𝗅1,…,𝗀𝗈𝖺𝗅𝑛,𝗍𝗁𝗆𝑛⟶𝗍𝗁𝗆). The validation function must rebuild the promised theorem from subtheorems. A buggy tactic can fail, loop, or choose a poor proof; absent an unsafe escape hatch, it cannot forge a 𝗍𝗁𝗆. This is the central LCF separation between a small trusted kernel and untrusted proof search.
For an exact tactic-to-kernel trace, consider the goal ⊢(𝜆𝑥.(𝜆𝑦.𝑦)𝑦)=(𝜆𝑥.𝑦). A derived abstraction tactic replaces it by the subgoal ⊢(𝜆𝑦.𝑦) 𝑦 =𝑦 and stores a validation that calls ABS on the returned theorem. A beta tactic closes that subgoal by the primitive BETA constructor. Composing the validations yields the complete primitive trace 𝑋⊢(𝜆𝑦.𝑦)𝑦=𝑦BETA⊢(𝜆𝑥.(𝜆𝑦.𝑦)𝑦)=(𝜆𝑥.𝑦)ABS. The empty assumption set discharges ABS’s freshness condition. The HOL4 course’s longer forward trace for ⊢∀𝑝. 𝑝 ⇒𝑝 uses derived DISCH and GEN at the interface [Tue19]; replaying that trace in the frozen core must additionally expand the connective definitions and record all type and term instantiations.
Suppose the host language enforces abstraction of 𝗍𝗁𝗆, and every exported kernel constructor implements one sound inference rule. Every theorem returned by any composition of tactics is semantically valid.
Referenced from 3 locations
Proof of Theorem 65.4 — LCF confinement
Proof. By representation independence, a tactic can obtain a theorem value only as an input or as the result of an exported constructor. Induction on the finite constructor trace reduces validity to theorem 65.2. ◻
The premise is operational, not ornamental. Unsafe casts, mutable corruption, or an oracle constructor enlarge the trusted base and require a new soundness argument.
Comparison with proof-relevant type theory
Under Curry–Howard, a judgment 𝑝 :𝑃 exposes a proof term whose type is the proposition. In HOL, 𝑃 :𝖻𝗈𝗈𝗅, while a kernel theorem asserting ⊢𝑃 lives at the implementation level. HOL proof objects may be recorded and replayed, but 𝖻𝗈𝗈𝗅 is not definitionally the host type 𝗍𝗁𝗆, and arbitrary inhabitants of a HOL type are not proofs.
Jacobs and Melham encode dependent types in HOL by predicates. A dependent type over 𝐴 becomes a predicate on an underlying HOL type; dependent functions carry closure obligations saying that admissible inputs are sent to admissible outputs. Their Theorem 4.8 gives a translation of derivable judgments of the selected dependent type theory into HOL [JM93]. The paper also says that a full formal metatheoretic treatment is future work. We therefore use its stated derivability translation as a comparison, not as a claim that HOL and dependent type theory are definitionally equivalent or that every HOL axiom has computational proof content.
★★☆ Encode the family 𝖵𝖾𝖼(𝐴,𝑛) as an HOL predicate on lists, and state the closure obligation for a predicate-encoded dependent function that takes 𝑣 :𝖵𝖾𝖼(𝐴,𝑛) to a list of length 𝑛 +1. Explain why the result is a theorem about membership, not a dependent HOL typing judgment. (Half a page.)
Referenced from 3 locations
Seminar and practical
Suggested first pass.
Begin with exercise 65.5; then replay exercise 65.7.
★★☆ For each of 𝛽, 𝜂, choice, infinity, functional extensionality, and propositional extensionality, classify it as syntax, rule, axiom, derived theorem, or semantic construction. Defend every answer with one exact rule or model clause. (One page.)
Referenced from 4 locations
★★☆ An implementation adds 𝗈𝗋𝖺𝖼𝗅𝖾 :𝗌𝗍𝗋𝗂𝗇𝗀 →𝗍𝗁𝗆. Draw the new trust boundary. State the weakest specification of 𝗈𝗋𝖺𝖼𝗅𝖾 that makes theorem 65.4 true again. (Ten lines and one diagram.)
Referenced from 3 locations
★★★ Practical project.hol-kernel-trace-checker The companion artifact hol-kernel-trace-checker represents formulas by a small equality fragment and theorem values by replayable kernel traces. Add the missing side-condition check for ABS; then extend the valid equality-symmetry trace and one mutation that illegally abstracts over a free assumption. Record the Kappa commands and explain why rejection is a kernel property rather than a tactic property. (One page plus code.)
Referenced from 5 locations
Sources and theorem boundary
The kernel presentation and set-model picture are drawn from Gordon’s report, the HOL4 course packet, and the formal semantics of Kumar et al. [Gor85, Tue19, KAMO14]. The course’s slides 29–36 display the kernel and definition boundary; Kumar et al.’s Theorems 2–3 state soundness and consistency. The abstract theorem type and validation architecture originate in LCF [Mil79]. The predicate encoding is bounded by Jacobs and Melham’s stated translation theorem [JM93]. No claim here transfers normalization, proof relevance, or computational canonicity from a dependent type theory into classical HOL.