kernel_v0 — Verum's bootstrap meta-theory
kernel_v0 is the Verum-language mirror of the
host-implementation trusted-base proof-term checker. It lives
at core/verify/kernel_v0/ and ships a hand-auditable 10-rule
rule description used by the bootstrap manifest and its audits. Its
existence does not establish every other kernel rule or a self-hosted
checking implementation.
The architectural goal is an executable Verum checker with a verifiable bootstrap chain. The current registry slot is a Rust wrapper: it calls the direct checker and then inspects rule manifests and policy. Self-hosting requires an additional implementation and a compilation trust argument.
For the layered three-rule-tier architecture see
Trusted kernel. For the three-kernel
differential testing — including kernel_v0 as the third
algorithmic slot — see
Three-kernel architecture.
1. The architectural picture
Verum-side rule descriptions → bootstrap manifest and citations
↓
.vproof → direct Certificate::verify → manifest/policy checks
↓
kernel_v0 registry-slot verdict
The manifest classifies rules as structurally discharged, attributed to a framework, or carrying an outstanding obligation. An empty outstanding-IOU list is a property of that classification. It does not mean every cited result has been replayed as a local proof or that the implementation's soundness follows from the list.
2. The 10 minimal rules
| Rule | File | Status | Description |
|---|---|---|---|
| K-Var | rules/k_var.vr | Proved | Variable lookup in context: Γ, x:A ⊢ x : A |
| K-Univ | rules/k_univ.vr | Proved | Universe(l) : Universe(succ l) — universe stratification, polymorphic over level expressions (Concrete/Var/Succ/Max) |
| K-Pi-Form | rules/k_pi_form.vr | DischargedByFramework (mathlib4) | Π-type formation: (A:U(n)) → (B:U(m)) in U(max(n,m)) |
| K-Lam-Intro | rules/k_lam_intro.vr | DischargedByFramework (mathlib4) | λ introduction: body's type under binder gives Π type |
| K-App-Elim | rules/k_app_elim.vr | DischargedByFramework (mathlib4) | Apply elimination + substitution |
| K-Beta | rules/k_beta.vr | DischargedByFramework (mathlib4) | β-reduction (λx.M) N ⤳ M[N/x] is type-preserving |
| K-Eta | rules/k_eta.vr | DischargedByFramework (lean4_stdlib) | η-equivalence λx.(f x) ≡ f when x ∉ FV(f) |
| K-Sub | rules/k_sub.vr | DischargedByFramework (mathlib4) | Subtyping (universe cumulativity) |
| K-FwAx | rules/k_fwax.vr | Proved | Foundation-aware axiom admission (Prop-only) |
| K-Pos | rules/k_pos.vr | Proved | Positivity check (Berardi 1998 — non-positive ⇒ ⊥) |
Status reflects the broader 38-rule kernel-soundness corpus at
core/verify/kernel_soundness/. Four of the ten are already
proved structurally; six are DischargedByFramework with
cited upstream proofs (mathlib4 / lean4_stdlib). Zero rules
sit at Admitted — both the kernel-v0 manifest's status table
below AND the broader 38-rule registry have an empty
iou_axiom_specs(). See
framework axioms — IOU registry
for the discharge protocol.
The audit gate verum audit --kernel-v0-roster walks the
manifest and confirms every rule has its corresponding .vr
file. Drift between manifest and filesystem is a build failure.
3. Trust base — what the auditor reads
The trusted base is small enough for an auditor to read end to end:
| Component | Trust contribution |
|---|---|
proof_checker module | extended-CoC checker (Π/Σ/Id with universe polymorphism) — 13 rules, bidirectional infer + check |
kernel_v0/ Verum source | hand-auditable 10-rule mirror; one file per rule plus soundness lemmas |
| Manifest verifier | structural type-check + manifest audit-cleanness + meta-soundness footprint + per-rule strict-intrinsic dispatch |
The Verum-side descriptions make judgments and obligations inspectable in the language. A complete self-hosting claim additionally needs execution of the checker, preservation through its compiler and an explicit bootstrap trust chain. Changing the implementation language alone does not discharge those obligations.
4. The differential-kernel role
kernel_v0 is the third slot in
verum audit --differential-kernel:
| Slot | Implementation | Status |
|---|---|---|
| 1 | proof_checker (Algorithm A — bidirectional + WHNF) | active |
| 2 | proof_checker_nbe (Algorithm B — NbE) | active |
| 3 | KernelV0Kernel (Algorithm C — manifest-driven verifier consuming the Verum-source kernel_v0/ manifest) | active |
The differential gate's invariant strengthens: every certificate is compared across the selected registry slots. The third slot depends on the first; disagreements require inspection of both term-checking and policy outcomes.
5. The file layout
core/verify/kernel_v0/
├── README.md ← architectural overview
├── mod.vr ← module aggregator
├── core_term.vr ← CoreTerm inductive (mirrors proof_checker::Term)
├── context.vr ← Context (de Bruijn-indexed type stack)
├── judgment.vr ← Γ ⊢ t : T judgment (well-typedness)
├── soundness.vr ← top-level soundness lemma
├── rules/
│ ├── mod.vr ← rule aggregator
│ ├── k_var.vr ← K-Var
│ ├── k_univ.vr ← K-Univ
│ ├── k_pi_form.vr ← K-Pi-Form
│ ├── k_lam_intro.vr ← K-Lam-Intro
│ ├── k_app_elim.vr ← K-App-Elim
│ ├── k_beta.vr ← K-Beta
│ ├── k_eta.vr ← K-Eta
│ ├── k_sub.vr ← K-Sub
│ ├── k_fwax.vr ← K-FwAx
│ └── k_pos.vr ← K-Pos
└── lemmas/
├── mod.vr ← lemma aggregator
├── beta.vr ← β-confluence (Newman's lemma)
├── eta.vr ← η-confluence
├── sub.vr ← subtyping refl/trans
├── subst.vr ← substitution lemma
└── cartesian.vr ← Cartesian closure of contexts
Every file is hand-readable Verum source.
6. Per-rule verbosity — K-Var worked example
A representative file (rules/k_var.vr) ships:
- The judgment:
Γ ⊢ Var(n) : Γ[n]for a well-formed context. - The Verum encoding as
introduce_var, returningMaybe<Derivation>— a variable derivation when lookup succeeds, andNoneotherwise. - A soundness lemma: "if
K-Varadmits(Γ, n), thenΓ[n]is well-typed inΓ". - The lemma's discharge: a structural induction on the context's de Bruijn level.
Each of the 10 rule files has the same structure — judgment + encoding + lemma + discharge or admit. Auditors read the file end-to-end without external dependencies.
7. Discharge dashboard — every rule is audit-clean
The 10 kernel_v0 rules split into two L4-acceptable discharge classes:
$ verum audit --kernel-v0-roster
rule status citation
───────────── ────────────────────── ───────────────────────────────────
K-Var discharged (structural — verum_kernel::proof_checker)
K-Univ discharged (structural — verum_kernel::proof_checker)
K-Pi-Form discharged_by_framework mathlib4 / Mathlib.LambdaCalculus.LambdaPi
.KindPreservation.pi_form_universe_max
K-Lam-Intro discharged_by_framework mathlib4 / Mathlib.LambdaCalculus.LambdaPi
.Substitution.context_extension
K-App-Elim discharged_by_framework mathlib4 / Mathlib.LambdaCalculus.LambdaPi
.Substitution.subst_preserves_typing
K-Beta discharged_by_framework mathlib4 / Mathlib.Computability.Lambda.ChurchRosser
K-Eta discharged_by_framework lean4_stdlib / Function.funext
K-Sub discharged_by_framework mathlib4 / Mathlib.SetTheory.Ordinal.Cumulative
.cumulative_hierarchy
K-FwAx discharged (structural — verum_kernel::proof_checker)
K-Pos discharged (structural — Berardi 1998 positivity check)
4 / 10 structurally discharged
6 / 10 discharged-by-framework (vetted upstream citation)
0 / 10 admitted_with_iou
0 / 10 not_yet_attested
audit-clean: 10 / 10 ✓ load-bearing
The 6 framework-discharged rules each carry a structured
citation triple (lemma_path, framework, citation):
lemma_path— the path to the discharge stub incore/verify/kernel_v0/lemmas/carrying the same@frameworkattribute (e.g.core.verify.kernel_v0.lemmas.beta.church_rosser_confluence).framework— the upstream framework name (mathlib4/lean4_stdlib).citation— the concrete upstream artefact identifier (e.g.Mathlib.Computability.Lambda.ChurchRosser).
The audit policy accepts both structurally discharged and framework-attributed statuses. These are different evidence kinds. A citation triple can identify an intended upstream result; it does not verify that result's existence, its exact assumptions, or its applicability to this implementation merely by being present. A consumer requiring local replay must retain the corresponding proof artifact and interpretation separately.
8. Why a separate Verum-side mirror
The mirror exposes the intended judgments, their dependencies and their source-level presentation. It supports manifest-drift checks and provides an interface for an eventual executable Verum checker.
The existing differential gate compares the direct and NbE algorithms; its bootstrap slot adds checks on the mirror's manifest while reusing the direct verdict. This is useful audit infrastructure with a clear boundary, not evidence that a second implementation is already running in Verum.
9. Cross-references
- Trusted kernel — the three-layer rule architecture.
- Three-kernel architecture —
the differential layer where
kernel_v0is registered as the third algorithmic slot (Algorithm C). - Reflection tower — the meta-soundness layer above the kernels.
- Soundness gates — the predicate-level formalisation.
- Audit protocol —
the
--kernel-v0-rosterand--soundness-iougates.