247 System \(\mathbb {P}\): A Proof Assistant

The systems of the previous sections were built to settle particular difficulties. Taken together they specify an implementation. This section sets it out and compares it with the three assistants in current use.

247.1 What the Existing Assistants Carry

Difficulty Source
Coq two universe worlds, Prop impredicative and Set predicative \(\ell = \mathrm {stip}\), applied twice
extraction may lose computational content proof erasure is a separate mechanism
axioms admissible and not tracked in types Axiom is a top-level command
   
Agda termination checking is syntactic, rejecting legitimate definitions no measure in the theory
–cubical and –with-K are incompatible two accounts of identity
instance resolution is not confluent search is part of elaboration
   
Lean 4 proof irrelevance for Prop is an axiom no reduction rule
Classical.choice is imported by default constructivity is opt-out
the kernel is large each stipulation needs a check

The entries have a common root. All three set \(\ell = \mathrm {stip}\): the universe hierarchy is a rule the kernel must enforce rather than a quantity it computes. Every further stipulation — proof irrelevance, erasure, the termination criterion — is another such rule, and each enlarges the code that must be trusted.

\begin{equation} \ell = \mathrm {stip} \;\Longrightarrow \; \text {constraints checked externally} \;\Longrightarrow \; \text {trusted base grows.} \tag{16059}\end{equation}

247.2 The Design

Definition 247.1. \(\mathbb {P}\) is the theory \(\Omega \) of the preceding classification,

\begin{equation} \Omega = (\,\delta = 1,\ \pi = \mathrm {pred},\ \iota = 1,\ \lambda = \mathrm {restr},\ \rhd = 1,\ \ell = \mathrm {derived}\,), \tag{16060}\end{equation}
together with an execution layer and a search layer.

Layer Fragment Guarantees
kernel \(\rhd \)-free, \(\ell \) computed SN, confluence, decidable conversion
search \(\rhd \)-typed, \(\mathrm {fix}\) available Turing-complete, may diverge
execution \(\rhd \)-free after erasure terminating, extractable

The three layers are distinguished in the types, not by convention. A term either mentions \(\rhd \) or does not, and the kernel accepts only those that do not.

247.3 Twelve Rules

The kernel implements the following and nothing else.

Rule Role
1 \(\ell \) assignment levels computed, not checked
2 \(\Pi \) formation, introduction, elimination functions
3 \(\Sigma \) formation, introduction, elimination pairs
4 inductive formation and elimination data
5 \(\mathbb {I}\) with \(\wedge ,\vee ,{-}\) the interval
6 \(\mathrm {comp}\) transport, per former
7 \(\mathrm {Glue}\) univalence as a theorem
8 \(\varinjlim \) higher inductive types
9 \(!\) on data types only duplication where harmless
10 \(\rhd \) and \(\mathrm {fix}\), sealed search layer
11 \(\beta \), \(\eta \) computation
12 conversion by normal form equality

Theorem 247.2 (Kernel correctness). On the \(\rhd \)-free fragment: every well-typed term is strongly normalising under the measure \((\ell ,\dim ,|t|)\); reduction is confluent by a finite critical-pair check over rules 1–12; hence \(A \equiv B\) iff \(\mathrm {nf}(A) = \mathrm {nf}(B)\), and type checking is decidable.

Corollary 247.3 (No axioms). \(\mathbb {P}\) admits no axiom without a computation rule. Univalence is rule 7, proof irrelevance is a consequence of \(\ell \) and \(\varinjlim \) rather than a postulate, and the universe hierarchy is rule 1.

247.4 Search Proposes, the Kernel Disposes

\begin{equation} \underbrace {\text {tactics, automation, search}}_{\rhd \text {-typed}} \;\xrightarrow {\ \text {witness}\ }\; \underbrace {\text {kernel}}_{\rhd \text {-free}} \;\longrightarrow \; \text {accept or reject} \tag{16061}\end{equation}

A tactic is a term of type \(\rhd (\text {Proof of }\varphi )\). It may loop, backtrack, call an external solver, or fail. What it eventually produces is a \(\rhd \)-free term, and that term is checked by the twelve rules. Nothing about the search enters the trusted base.

This resolves the difficulties listed for Agda and Lean in the same stroke. Termination checking is not a separate syntactic criterion but the measure of the theory; instance resolution lives in the search layer where non-confluence is harmless; classical reasoning is available as a search strategy whose output must still typecheck constructively, or as an explicit hypothesis appearing in the statement.

247.5 Extraction Without Loss

Coq’s extraction erases Prop and can discard computational content that was placed there. In \(\mathbb {P}\) the relevant distinction is already in the types.

Proposition 247.4. For \(\rhd \)-free \(t\), the erasure \(|t|\) obtained by deleting \(\mathbb {I}\)-abstractions and \(\mathrm {comp}\) is a terminating program, and \(|t|\) computes the same function on data types as \(t\).

Paths carry no runtime content because \(\mathbb {I}\) is a formal interval; erasing them is sound by construction, not by a separate argument about which universe a proof inhabits.

247.6 Comparison

Coq Agda Lean 4 \(\mathbb {P}\)
\(\ell \) stip stip stip derived
Kernel rules (approx.) \(40\) \(35\) \(30\) \(\mathbf {12}\)
Univalence axiom cubical axiom rule 7
Canonicity fails with axioms yes fails yes
Proof irrelevance Prop — axiom derived
Termination check guard syntactic guard measure
Divergence marked in types no no no yes (\(\rhd \))
Search in trusted base partly partly partly no
Extraction erases Prop partial partial erases \(\mathbb {I}\)
Classical logic axiom axiom default hypothesis

247.7 What Is Not Claimed

Three qualifications belong here.

The rule count is not a fair single measure of trust. Twelve rules that each do more work are not obviously safer than thirty that each do less, and an implementation of rule 6 alone is substantial. What the count does record is that no rule in \(\mathbb {P}\) enforces a stipulation: each computes something.

Second, the existing assistants carry decades of libraries, tactics and practical engineering. Nothing here reproduces that, and a system without it is not a replacement in any operational sense.

Third, the design is specified, not implemented. The theorems cited are those of the preceding sections; an implementation would need proofs of strong normalisation and confluence carried out in full for the twelve rules together, and those are the results this section assumes rather than establishes.

Remark 247.5. The organising claim is narrow and worth separating from the rest. Every current assistant treats the universe hierarchy as a constraint to enforce, and this choice propagates: once one stipulation is in the kernel, others follow, and the trusted base is the sum of them. Taking \(\ell = \mathrm {derived}\) removes the first, and the design above is what remains when the rest are removed with it.

The residue is unchanged. \(\mathbb {P}\) has no \(\mathcal {U}^{(\infty )}\), proves the consistency of each level only from the level above, and cannot interpret itself. It is a partial system, and the twelve rules are what a partial system can check.

\begin{equation} \boxed { \mathbb {P} = \Omega + \text {erasure} + \text {sealed search}, \qquad \text {kernel} = 12 \text { computing rules}, \qquad \text {axioms} = 0 .} \tag{16062}\end{equation}

247.8 Normalisation for the Twelve Rules

This section carries out the argument assumed in the previous one. The measure alone does not suffice, so the proof is in two layers: a reducibility argument for the functional rules and a dimension argument for the cubical ones. The three points that resist a routine treatment are handled in order.

247.9 Why the Measure Alone Fails

Take

\begin{equation} \mu (t) = \bigl (\ell (t),\ \dim (t),\ |t|\bigr ) \tag{16063}\end{equation}
lexicographically, with \(\ell \) the level, \(\dim \) the nesting depth of \(\mathrm {comp}\) together with the count of free interval variables, and \(|t|\) the symbol count.

Rules 5–8 decrease \(\dim \). Rule 11 does not decrease \(|t|\): for \((\lambda x.t)\,u \to t[u/x]\) with \(x\) occurring \(n\) times,

\begin{equation} \bigl |t[u/x]\bigr | = |t| + (n-1)\,|u|, \tag{16064}\end{equation}
which exceeds \(|(\lambda x.t)\,u|\) whenever \(n \geq 2\). Substitution is not size-decreasing, and no purely syntactic measure repairs this. The functional rules therefore need reducibility.

Rules Method Decreasing quantity
5–8 (\(\mathbb {I}\), \(\mathrm {comp}\), \(\mathrm {Glue}\), \(\varinjlim \)) measure \(\dim \)
2–4, 11–12 (\(\Pi \), \(\Sigma \), inductives, \(\beta \eta \)) reducibility —
1, 9, 10 (\(\ell \), \(!\), \(\rhd \)) structural see §247.13

247.10 Reducibility Indexed by \(\ell \)

Definition 247.6 (Candidates). For each type \(A\) define \(\mathrm {Red}_A \subseteq \Lambda \) by recursion on \(\ell (A)\), and within a level by recursion on type structure:

\begin{align} \mathrm {Red}_{\mathbb {N}} &= \{\,t : t \twoheadrightarrow \text {numeral}\,\}, \tag{16065}\\ \mathrm {Red}_{\Pi _{x:A}B} &= \{\,t : \forall u \in \mathrm {Red}_A,\ t\,u \in \mathrm {Red}_{B[u/x]}\,\}, \tag{16066}\\ \mathrm {Red}_{\Sigma _{x:A}B} &= \{\,t : \pi _1 t \in \mathrm {Red}_A,\ \pi _2 t \in \mathrm {Red}_{B[\pi _1 t/x]}\,\}, \tag{16067}\\ \mathrm {Red}_{\mathrm {Path}_A(x,y)} &= \{\,p : \forall r \in \mathbb {I},\ p(r) \in \mathrm {Red}_A\,\}, \tag{16068}\\ \mathrm {Red}_{\mathcal {U}^{(n)}} &= \{\,A : \ell (A) \leq n \ \text {and}\ \mathrm {Red}_A \ \text {is defined}\,\}. \tag{16069}\end{align}

Proposition 247.7 (The definition is well founded). Since \(\ell (\mathcal {U}^{(n)}) = n+1\) and every element of \(\mathcal {U}^{(n)}\) has level at most \(n\), the clause for universes appeals only to \(\mathrm {Red}_A\) with \(\ell (A) < \ell (\mathcal {U}^{(n)})\). Every other clause appeals to types of the same level and smaller structure.

This is where \(\ell = \mathrm {derived}\) earns its place. When the hierarchy is stipulated, the recursion has to be justified against an externally imposed constraint; when \(\ell \) is computed by rule 1, the recursion is on a quantity the theory already assigns to every type.

Lemma 247.8 (CR1–CR3). Each \(\mathrm {Red}_A\) satisfies: (i) \(\mathrm {Red}_A \subseteq \mathrm {SN}\); (ii) \(t \in \mathrm {Red}_A\) and \(t \to t'\) imply \(t' \in \mathrm {Red}_A\); (iii) if \(t\) is neutral and every one-step reduct of \(t\) lies in \(\mathrm {Red}_A\), then \(t \in \mathrm {Red}_A\).

Sketch. Induction on \(\ell (A)\) then on type structure, as in the standard argument for dependent types. The path clause is handled like the function clause with \(\mathbb {I}\) in place of the domain; interval variables contribute to \(\dim \) and not to the candidate structure. □

247.11 (a) Composition Through Glue

Rule 7 is the one that makes univalence a theorem, and it is where the dimension argument has to be made precise.

Definition 247.9. Set

\begin{equation} \dim \bigl (\mathrm {Glue}\,[\varphi \mapsto (T,e)]\,A\bigr ) := \max \bigl (\dim T,\ \dim A\bigr ) + 1 . \tag{16070}\end{equation}

The composition rule for \(\mathrm {Glue}\) produces, from a system \(\psi \mapsto u\) and a base point \(g_0\),

\begin{equation} \mathrm {comp}^{\,i.\,\mathrm {Glue}[\varphi \mapsto (T,e)]A} (\psi \mapsto u)(g_0) \;\longrightarrow \; \mathrm {glue}\,[\,\varphi \mapsto t_1\,]\;a_1 \tag{16071}\end{equation}
with
\begin{align} t_1 &= \mathrm {comp}^{\,i.T}(\psi \mapsto u)(g_0) && \text {on } \varphi , \tag{16072}\\ a_1 &= \mathrm {comp}^{\,i.A} \bigl (\psi \mapsto \mathrm {unglue}\,u,\ \varphi \mapsto e(t_1)\bigr ) (\mathrm {unglue}\,g_0) && \text {everywhere.} \tag{16073}\end{align}

Proposition 247.10 (Dimension decreases). Every \(\mathrm {comp}\) on the right-hand side is taken at \(T\) or at \(A\), so

\begin{equation} \dim (\text {rhs}) \leq \max \bigl (\dim T,\ \dim A\bigr ) < \dim (\text {lhs}). \tag{16074}\end{equation}

The correction that makes \(a_1\) agree with \(e(t_1)\) on \(\varphi \) uses that \(e\) is an equivalence, hence that its fibres are contractible. The witness of contractibility is a fixed term of the context, containing no \(\mathrm {comp}\) at the level under consideration, so it contributes nothing to \(\dim \).

Lemma 247.11 (Reducibility is preserved). If \(u\) and \(g_0\) are reducible then so is the right-hand side.

Proof. \(t_1\) and \(a_1\) are compositions at \(T\) and \(A\), reducible by the induction hypothesis on \(\dim \). The constructor \(\mathrm {glue}\) is reducible when its components are, by CR3 applied to the elimination \(\mathrm {unglue}\). □

Remark 247.12 (Regularity). Definitional regularity — that \(\mathrm {comp}\) along a constant line with a constant system returns its input unchanged — does not hold for \(\mathrm {Glue}\) in the CCHM presentation, because the correction step yields a path rather than an identity. Two routes are available: adopt the cartesian presentation, in which regularity holds and \(\mathrm {comp}\) is replaced by \(\mathrm {hcom}\) and \(\mathrm {coe}\); or retain CCHM and carry regularity as a propositional equality. Normalisation does not depend on the choice: the proposition above uses only that \(\dim \) decreases, which holds in both.

247.12 (b) Higher Inductive Types at the Colimit

Rule 8 forms \(H = \varinjlim _n H_n\). Since the colimit is infinite, the measure cannot be read off the type; it is read off the element.

Lemma 247.13 (Every closed element is finite). For closed \(t : H\) there is \(n\) and a constructor \(c\) of \(H_n\) with \(t \twoheadrightarrow j_{n,\infty }(c)\).

Proof. The colimit is filtered and the inclusions \(j_n\) are the only maps into \(H\) other than the constructors. A closed term is built from finitely many constructor applications, each introduced at some finite stage; take \(n\) maximal among them. □

Definition 247.14. For \(t : H\) let \(\mathrm {stage}(t)\) be the least such \(n\), and set \(\dim (t) := \dim _{H_{\mathrm {stage}(t)}}(t)\).

Proposition 247.15 (Elimination reduces at a finite stage). The eliminator for \(H\) applied to \(j_{n,\infty }(c)\) reduces to the eliminator for \(H_n\) applied to \(c\), and the recursive occurrences are at stage \(< n\) or at structurally smaller arguments of stage \(n\).

Lemma 247.16 (Candidates at the colimit).

\begin{equation} \mathrm {Red}_H = \bigcup _n j_{n,\infty }\bigl (\mathrm {Red}_{H_n}\bigr ), \tag{16075}\end{equation}
and this is a reducibility candidate.

Proof. Each \(j_n\) preserves reducibility, so the family is directed. A directed union of candidates satisfies CR1–CR3: (i) each member is SN; (ii) reduction stays within the stage; (iii) neutrality is decided at the stage of the term. □

Example 247.17. For \(S^1\): \(H_0 = \{\mathrm {base}\}\), \(H_1 = H_0 \cup \{\mathrm {loop}\}\), and \(H_n = H_1\) for \(n \geq 1\). Every closed element has stage \(\leq 1\), elimination reduces on \(\mathrm {base}\) or \(\mathrm {loop}\), and the candidate is \(j_{1,\infty }(\mathrm {Red}_{H_1})\).

247.13 (c) The Guard Boundary

Rule 10 introduces \(\rhd \) and \(\mathrm {fix} : (\rhd A \to A) \to A\). The output type of \(\mathrm {fix}\) can be \(\rhd \)-free, so closure must be stated at the level of subterms rather than of the final type.

Definition 247.18. \(t\) is guard-free iff no subterm of \(t\) has a type mentioning \(\rhd \).

Proposition 247.19. \(\mathrm {fix}\,f\) is never guard-free.

Proof. \(f\) is a subterm of \(\mathrm {fix}\,f\) and has type \(\rhd A \to A\). □

Lemma 247.20 (Closure under reduction). If \(t\) is guard-free and \(t \to t'\) then \(t'\) is guard-free.

Proof. By cases on the rule. Rules 11–12 substitute or compare existing subterms and introduce no new types. Rules 5–8 expand a composition into compositions at the component types of the same former, all already present as subtypes. Rule 9 restricts \(!\) to data types, which do not mention \(\rhd \). No rule introduces a subterm whose type mentions \(\rhd \) where none did before. □

Theorem 247.21 (The kernel fragment is closed). The guard-free terms form a subsystem closed under typing and reduction, and \(\mathrm {fix}\) does not occur in it.

247.14 Main Theorem

Theorem 247.22 (Strong normalisation). Every guard-free well-typed term of \(\mathbb {P}\) is strongly normalising.

Proof. By the closure theorem, guard-free terms contain no \(\mathrm {fix}\). The remaining rules split as tabulated: rules 5–8 strictly decrease \(\dim \), by §247.11 for \(\mathrm {Glue}\) and §247.12 for colimits; rules 2–4 and 11–12 are handled by the candidates, whose definition is well founded on \(\ell \) by rule 1. Since \(\dim \) is a natural number and the candidate argument gives SN at fixed \(\dim \), the lexicographic combination is well founded. □

Theorem 247.23 (Confluence). Reduction on the guard-free fragment is confluent.

Proof. The rule set is finite. Critical pairs occur only where two rules match overlapping patterns; enumerating them:

Overlap Rules Resolution
\(\beta \) inside \(\mathrm {comp}\) 11, 6 both orders give the same reduct
\(\mathrm {comp}\) at \(\Pi \) 6, 2 the \(\Pi \) rule is an instance
\(\mathrm {comp}\) at \(\mathrm {Glue}\) 6, 7 §247.11
\(\mathrm {comp}\) at a colimit 6, 8 reduces at the stage
\(\eta \) against \(\beta \) 11 standard
elimination at \(j_{n,\infty }\) 8, 4 §247.12

All converge, and strong normalisation gives confluence by Newman’s lemma. □

Corollary 247.24 (Decidable conversion). \(A \equiv B\) iff \(\mathrm {nf}(A) = \mathrm {nf}(B)\), and type checking on the guard-free fragment is decidable.

Corollary 247.25 (Canonicity). Every closed guard-free term of type \(\mathbb {N}\) reduces to a numeral.

Proof. By SN it has a normal form; by the candidate clause for \(\mathbb {N}\) that normal form is a numeral. No \(\mathrm {comp}\) blocks it, since composition at \(\mathbb {N}\) is the identity, and no axiom occurs, since \(\mathbb {P}\) has none. □

247.15 What This Establishes

Point
Measure alone insufficient
Candidates well founded on \(\ell \)
(a) \(\mathrm {Glue}\): \(\dim \) decreases
(b) HIT: finite stage, directed union
(c) \(\rhd \): subterm closure
SN, confluence, decidability

The arguments for CR1–CR3 and for the critical pairs are given in outline; each is a routine but lengthy case analysis over the twelve rules, and writing them in full is the content of a separate paper. The three points identified as resistant are settled here, and none of them required an addition to the rule set.

\begin{equation} \boxed { \text {guard-free} \;\Longrightarrow \; \mathrm {SN} \ \wedge \ \text {confluent} \;\Longrightarrow \; \text {conversion decidable},\ \text {canonicity}.} \tag{16076}\end{equation}

247.16 Classical Logic as a Second Seal

System \(\mathbb {P}\) is constructive. This section adds classical reasoning without disturbing the kernel, by the same device already used for non-termination: a modality in the types marks where the extra principle was used.

247.17 What Classical Logic Requires

Three principles, mutually derivable over intuitionistic logic:

\begin{align} \mathrm {LEM} &: A \vee \neg A, \tag{16077}\\ \mathrm {DNE} &: \neg \neg A \to A, \tag{16078}\\ \mathrm {Peirce} &: ((A \to B) \to A) \to A . \tag{16079}\end{align}

None is provable in \(\mathbb {P}\), and adding any as an axiom would reintroduce exactly what rule 7 was built to avoid: a constant with no computation rule, hence a normal form that blocks canonicity.

247.18 The Modality

Definition 247.26.

\begin{equation} \Diamond A := \neg \neg A = (A \to \bot ) \to \bot . \tag{16080}\end{equation}

Proposition 247.27 (\(\Diamond \) is a monad).

\begin{align} \eta _A &: A \to \Diamond A, && \eta (a) = \lambda k.\ k\,a, \tag{16081}\\ \mu _A &: \Diamond \Diamond A \to \Diamond A, && \mu (m) = \lambda k.\ m\,(\lambda f.\ f\,k), \tag{16082}\end{align}

and the monad laws hold definitionally.

Proposition 247.28 (\(\Diamond A\) is a proposition). In the sense of \(\mathcal {H}\): \(\Diamond A\) is an \(h\)-proposition for every \(A\), since \(\bot \) is and function types into a proposition are propositions.

Theorem 247.29 (Excluded middle holds under \(\Diamond \)). For every \(A\),

\begin{equation} \Diamond \bigl (A \vee \neg A\bigr ) \tag{16083}\end{equation}
is provable in \(\mathbb {P}\) with no additional principle.

Proof. Assume \(k : (A \vee \neg A) \to \bot \). Then \(\lambda a.\ k(\mathrm {inl}\,a) : \neg A\), so \(k(\mathrm {inr}(\lambda a.\ k(\mathrm {inl}\,a))) : \bot \). □

Classical logic is therefore not added. It is already present, inside the modality.

Definition 247.30 (Stability). \(A\) is stable if \(\Diamond A \to A\).

Proposition 247.31. Decidable types are stable; \(\bot \), \(\top \), equality on \(\mathbb {N}\) and every \(h\)-proposition with decidable equality are stable; and \(\Diamond A\) is stable for every \(A\).

On the stable fragment, \(\mathrm {LEM}\), \(\mathrm {DNE}\) and \(\mathrm {Peirce}\) hold outright.

247.19 Computational Content

The modality is not a device for hiding classical reasoning; it has an execution.

Proposition 247.32 (Griffin). Under the Curry–Howard reading, \(\mathrm {Peirce}\) is the type of \(\mathrm {callcc}\):

\begin{equation} \mathrm {callcc} : ((A \to B) \to A) \to A . \tag{16084}\end{equation}

A term of type \(\Diamond A\) is a computation in the continuation monad. Running it means supplying a continuation \(k : A \to \bot \), and a classical proof extracts to a program that may capture and invoke \(k\). The computation is effectful, and \(\Diamond \) is the type-level record of that effect.

Marks Effect
\(\rhd \) possible non-termination unbounded recursion
\(\Diamond \) use of classical reasoning control, continuations

Theorem 247.33 (Closure). The \(\Diamond \)-free fragment is closed under typing and reduction, and contains no use of \(\mathrm {LEM}\), \(\mathrm {DNE}\) or \(\mathrm {callcc}\).

Proof. As in the guard case: \(\mathrm {callcc}\) has a subterm of type \((A \to B) \to A\) with \(B = \bot \), so any term using it has a subterm whose type mentions \(\bot \) in negative position. No rule introduces such a subterm where none was present. □

247.20 Faithfulness

Nothing classical is lost.

Theorem 247.34 (Gödel–Gentzen). For every first-order \(\varphi \),

\begin{equation} \mathrm {PA} \vdash \varphi \iff \mathrm {HA} \vdash \varphi ^{\Diamond }, \tag{16085}\end{equation}
where \((\cdot )^{\Diamond }\) inserts \(\Diamond \) before atoms, disjunctions and existentials.

Corollary 247.35. Classical arithmetic embeds in \(\mathbb {P}\) as the \(\Diamond \)-modal fragment, and classical analysis follows by the same translation over the appropriate base.

Theorem 247.36 (Friedman). If \(\mathrm {PA} \vdash \forall x\,\exists y\ R(x,y)\) with \(R\) primitive recursive, then \(\mathrm {HA}\) proves the same statement, and a witness is extractable.

So a classical proof of a \(\Pi ^0_2\) statement yields a program, and the program is the extraction of the \(\Diamond \)-term.

247.21 Three Layers

Fragment Marked by Guarantees Contains
kernel — SN, canonical, decidable constructive proofs
classical \(\Diamond \) terminating, effectful LEM, DNE, choice\(_\omega \)
search \(\rhd \) Turing-complete tactics, automation

The two seals are independent. A term may be \(\Diamond \)-typed and \(\rhd \)-free: a classical proof that terminates. A term may be \(\rhd \)-typed and \(\Diamond \)-free: a constructive search that may not. The kernel accepts terms free of both.

\begin{equation} \mathbb {P}\text {-kernel} \;\subset \; \mathbb {P}^{\Diamond } \;\subset \; \mathbb {P}^{\Diamond ,\rhd } . \tag{16086}\end{equation}

247.22 Why Two-Valuedness Is the Seal

\(\mathrm {LEM}\) asserts that every proposition takes one of two values. In the partition reading this is

\begin{equation} O + U = 1 \quad \text {with}\quad O, U \in \{0,1\}, \tag{16087}\end{equation}
whereas the constructive reading permits intermediate splits. The modality therefore marks the point at which the partition is required to be discrete.

This is the same condition identified in system \(\mathcal {M}\). There the liar had a unique solution \(v = \tfrac 12\) in \([0,1]\) and none in \(\{0,1\}\), because the discrete metric admits no non-constant contractions. Classical logic is the discrete case, and \(\Diamond \) is where that case is entered.

Setting Values Self-referential equation
\(\mathbb {P}\)-kernel a type, not two values no fixed point demanded
\(\mathbb {P}^{\Diamond }\) \(\{0,1\}\) on stable types unsolvable: paradox
\(\mathcal {M}\) \([0,1]\) unique solution \(\tfrac 12\)

Remark 247.37. The classical principles were never removed from \(\mathbb {P}\); they were never available unmarked. \(\Diamond (A \vee \neg A)\) is a theorem, and what a classical development does is work inside \(\Diamond \) throughout. Marking that is not a restriction on classical mathematics but a record of where two-valuedness was assumed, in the same way that \(\rhd \) records where termination was not.

The residue is the one carried since the beginning. A proposition is decided classically by placing it at \(O = 1\) or \(U = 1\); the kernel does not decide it, and the modality is the note that the decision was imported. Nothing in \(\mathbb {P}\) decides its own \(\Diamond \)-fragment, which is \(O \subsetneq T\) once more.

\begin{equation} \boxed { \Diamond = \neg \neg , \qquad \Diamond (A \vee \neg A) \ \text {is a theorem}, \qquad \text {kernel} = \Diamond \text {-free} \wedge \rhd \text {-free}.} \tag{16088}\end{equation}

247.23 HOL and Isabelle

The classification of §Space of Type Theories was drawn over systems in which types are terms. HOL is not one of these, and Isabelle is a framework rather than a theory. Both need a further value on the stratification axis, and both sit in the classification once it is added.

247.24 A Fourth Value for \(\ell \)

Definition 247.38. Extend the stratification axis to

\begin{equation} \ell \in \{\,\mathrm {none},\ \mathrm {rigid},\ \mathrm {stip},\ \mathrm {derived}\,\}, \tag{16089}\end{equation}
where \(\mathrm {rigid}\) means that types and terms are separate syntactic categories, permanently, so that \(\mathcal {U} : \mathcal {U}\) cannot be written for want of a category in which to write it.

HOL takes \(\ell = \mathrm {rigid}\). Girard’s paradox is not blocked by a hierarchy or by a level function; it is not expressible, because a type is never a term and there is nothing for a universe to be an element of.

\(\ell \) Mechanism Cost
none — inconsistent with \(\pi = \mathrm {impred}\)
rigid types are not terms no dependency, \(\delta = 0\)
stip a rule forbidding \(\mathcal {U}:\mathcal {U}\) kernel enforces it
derived \(\ell (\mathcal {U}^{(n)}) = n{+}1\) kernel computes it

The rigid choice buys its safety with \(\delta = 0\): since types cannot mention terms, there is no \(\mathrm {Vec}\ n\), no \(\Sigma \)-type carrying a proof, and no proposition depending on a value except through the encoding of predicates as functions into \(\mathrm {bool}\).

247.25 HOL as a Point

\(\delta \) \(\pi \) \(\iota \) \(\lambda \) \(\rhd \) \(\ell \)
HOL \(0\) impred \(0\) free \(0\) rigid
Isabelle/Pure \(0\) impred \(0\) free \(0\) rigid
Isabelle/HOL \(0\) impred \(0\) free \(0\) rigid
\(\mathbb {P}\) \(1\) pred \(1\) restr \(1\) derived

Impredicativity is safe here for the same reason: quantification over \(\mathrm {bool}\) is quantification over a type, and types are not among the things quantified over.

HOL’s kernel is small. In the LCF tradition it consists of about ten primitive inference rules together with three axioms, and every theorem is a value of an abstract type constructible only by those rules. This is a different route to a small trusted base than the one \(\mathbb {P}\) takes, and it is the route that has been hardened longest.

247.26 Where the Axioms Sit

HOL takes three axioms beyond the inference rules.

Axiom Statement Status in \(\mathbb {P}\)
Extensionality \((\forall x.\ f\,x = g\,x) \to f = g\) derivable: rule 5, funext
Choice \(P\,x \to P\,(\varepsilon \,P)\) \(\Diamond \)-marked
Infinity \(\exists f : \mathrm {ind}\to \mathrm {ind}\) injective, not surjective rule 4, \(\mathbb {N}\)

Function extensionality is an axiom in HOL and a theorem in \(\mathbb {P}\), since paths are functions out of \(\mathbb {I}\) and \(\mathrm {funext}\) is the exchange of two abstractions.

Hilbert’s \(\varepsilon \) is the substantive one. It is a global choice operator with no computation rule: \(\varepsilon \,P\) is a term that reduces to nothing. By Diaconescu’s argument choice implies excluded middle, so \(\varepsilon \) places the whole development inside the classical fragment.

Proposition 247.39. In \(\mathbb {P}\), an \(\varepsilon \)-like operator is typeable only as

\begin{equation} \varepsilon : \Pi _{A}\ \bigl (\Diamond A\bigr ) \to \bigl (A \to \mathrm {Prop}\bigr ) \to \Diamond A, \tag{16090}\end{equation}
so every use is recorded by the modality.

HOL does not record it because HOL is classical throughout; there is no unmarked fragment to fall out of. The difference is not that \(\mathbb {P}\) forbids choice but that it says where choice was used.

247.27 Type Definitions

HOL introduces new types by a metatheoretic mechanism. Given \(P : \tau \to \mathrm {bool}\) and a proof of \(\exists x.\ P\,x\), the command

\begin{equation} \mathtt {typedef}\ T = \{x : \tau \mid P\,x\} \tag{16091}\end{equation}
extends the signature with a type constant \(T\) and a bijection pair \(\mathrm {Abs}, \mathrm {Rep}\) between \(T\) and the subset. Quotients are built on top of this by a further package.

The mechanism is outside the logic: the kernel’s signature grows, and the correctness of the extension is a metatheorem about the definitional package rather than a derivation inside HOL.

In \(\mathbb {P}\) both constructions are internal.

HOL \(\mathbb {P}\)
subtype typedef, signature extension \(\Sigma _{x:A}\ P\,x\), rule 3
quotient quotient package higher inductive type, rule 8
new inductive datatype package rule 4
correctness metatheorem about the package typing derivation

247.28 Isabelle: Two Levels

Isabelle is a logical framework. Isabelle/Pure is a minimal intuitionistic higher-order logic with three connectives,

\begin{equation} \bigwedge \quad (\text {meta-universal}), \qquad \Longrightarrow \quad (\text {meta-implication}), \qquad \equiv \quad (\text {meta-equality}), \tag{16092}\end{equation}
and object logics such as Isabelle/HOL are encoded in it. Reasoning happens at two levels, and the encoding is a translation between them.

\(\mathbb {P}\) also has layers, but they are in the types rather than in separate logics.

Isabelle \(\mathbb {P}\)
framework Pure, a separate logic —
object level HOL, encoded the kernel fragment
classical use everywhere, unmarked \(\Diamond \)
search tactics, Sledgehammer \(\rhd \)
separation by logic by type

The framework level buys genericity: the same infrastructure serves HOL, ZF, and other object logics. The cost is that a statement exists twice, once as a Pure proposition and once as an object-level formula, and the relationship between them is maintained by the encoding rather than by typing.

247.29 Proof Terms

Isabelle can record proof terms but by default does not, for performance. What a session produces is a theorem value certified by the kernel at the time it was constructed; the derivation is not retained as an object.

Isabelle (default) \(\mathbb {P}\)
Proof is a kernel event a term
Retained no yes
Independently checkable no yes, by the twelve rules
Trusted base the kernel implementation the twelve rules

The difference matters for Sledgehammer. An external prover finds a proof, and Isabelle reconstructs it internally; reconstruction sometimes fails, and when it succeeds the result is again a kernel event rather than an artifact. In \(\mathbb {P}\) the external search is \(\rhd \)-typed, and what it returns is a \(\rhd \)-free term that the kernel checks: the same division of labour, with the witness kept.

247.30 Overloading

HOL’s type classes with overloaded constants require a side condition: definitions must be terminating with respect to a dependency relation on constants and types, or unsoundness follows. Isabelle enforces this by a check outside the logic.

In \(\mathbb {P}\) the level function serves. An overloaded definition is a family indexed by a type, and \(\ell \) orders the family; a cyclic dependency would require \(\ell (c) < \ell (c)\).

\begin{equation} \text {overloading sound} \;\Longleftrightarrow \; \text {the dependency relation is well founded} \;\Longleftarrow \; \ell \ \text {strictly increases along it}. \tag{16093}\end{equation}

247.31 Comparison

HOL Isabelle/HOL \(\mathbb {P}\)
Kernel rules \(\sim 10\) \(\sim 10\) (Pure) \(12\)
Axioms \(3\) \(3\) \(0\)
Dependent types no no yes
Constructive fragment none none the kernel
Classical use marked no no \(\Diamond \)
Divergence marked — — \(\rhd \)
Proof terms retained optional optional always
Quotients package package rule 8
Subtypes typedef typedef rule 3
Extensionality axiom axiom theorem
Choice axiom (\(\varepsilon \)) axiom \(\Diamond \)-marked
Univalence — — rule 7
Overloading check external external \(\ell \)

Two entries run the other way and are worth stating in the same table. The HOL kernel is smaller and has been in service longer, and its simplicity is a direct consequence of \(\delta = 0\): without dependency, type checking is trivial and the inference rules are few. And the Archive of Formal Proofs together with the HOL Light and HOL4 libraries represent a body of formalised mathematics that no new system possesses.

247.32 The Trade in One Line

\begin{equation} \boxed { \text {HOL}: \ \ell = \mathrm {rigid} \Rightarrow \delta = 0, \qquad \mathbb {P}: \ \ell = \mathrm {derived} \Rightarrow \delta = 1 .} \tag{16094}\end{equation}

HOL keeps types and terms apart and thereby avoids the hierarchy question entirely, at the price of dependency. \(\mathbb {P}\) admits types as terms and pays for it with a level function, gaining dependency, internal quotients, and computed univalence.

Remark 247.40. The three axioms of HOL are the three places where a classical higher-order logic must reach outside itself: extensionality, choice, infinity. In \(\mathbb {P}\) the first is a theorem about paths, the third is an inductive type, and the second is the only one that remains an importation — and it is exactly the one that Diaconescu’s argument shows to carry excluded middle with it. Marking it with \(\Diamond \) is not a restriction on classical mathematics but a statement of where the classical assumption entered.