Proof authoring theory

Theory

These pages state the mathematics behind this library: what a recipe means and why running one is sound, how each derived rule follows from the kernel's primitive rules, what matching computes, why guard normalization and support antichains preserve what they claim, what an evidence label guarantees, and why conversion combinators produce valid equalities. The kernel's own theory (syntax, typing, deduction, semantics, conversion) is in the kernel's theory pages, cited here as "the kernel's Theorem D-4" and so on.

The labels are those of the kernel's theory pages: Definition, Theorem, Lemma, Proposition (proved here), Theorem (cited), Algorithm, and Requirement (a property of the implementation that the proofs assume, with its tests). Results are numbered per page.

What justifies what

Component Results Page
Recipes, execution, closedness, determinism, agreement with direct calls R-1 to R-4 Recipes
Derived rules DR-1 to DR-14 Derived rules
Matching modulo ACU; metavariables M-1 to M-5 Matching and metavariables
Guards, normalization, supports, activation G-1 to G-6 Guards and supports
Guarded theorems, the store, the index T-1 to T-4 The theorem store
Evidence labels, external claims E-1 to E-3 Evidence labels and external claims
Conversion combinators C-1 to C-4 Conversions
Law bundles B-1 to B-2 Law bundles

The one principle

Every theorem on these pages has the same shape: if the kernel returned these judgments, then this judgment follows by these kernel rules. None assumes that the library's own code is correct. Where the library's code could be wrong (a matcher returning a bad match, a guard normalizer claiming a false equivalence, an index missing a theorem), the result is either verified by the kernel before use, or a missed opportunity, never an accepted false judgment. This is the kernel's checking at the boundary (its Theorem B-2) applied to a library.

judgment v1.0.0 for Mojo 1.2 · Apache License 2.0 with LLVM Exceptions · Source on GitHub