This page documents Regula 0.7.0. The latest release is Regula 0.11.1: this page in Regula 0.11.1.
8. Compliance and Quality Audit
Purpose
This module provides the checklist for auditing a project against this standard. It defines no independent rules; each checklist item links to the normative module specifying the Lean requirement and rationale.
No reduced or minimum compliance levels exist. A project conforms only when every applicable row passes across its claimed Lean surfaces. A known violation is FAIL; missing, unknown, untested, unsupported, or timed-out required evidence is INCOMPLETE. Both block conformance.
Applicability follows the stated technical condition. MUT-01–MUT-04 apply to checker qualification claims under §7.8, with new execution required only for affected capabilities whose evidence is invalidated; MUT-05 applies to a claimed separate serialized-graph check; and BUILD-* applies to an enabled enforcing-build claim. A conditional row passes when its condition is absent and that reason is recorded, or when every applicable occurrence conforms. An absent condition is not evidence that the corresponding checks ran.
This checklist does not address project management or general software assurance. It audits dependent types, theorem statements, proof terms, axioms, elaboration, modules, Lean computation mechanisms, and Lean documentation claims.
Audit Matrix
Assess each row against the actual claimed surface. The verification column includes both direct surface evidence and controls that qualify the supporting checker. Entries marked Qualification follow §7.8: qualification evidence is scoped to the detection implementation, supported toolchain, and invocation behavior it exercised. Reuse requires establishing that a change does not invalidate that evidence; version identity alone is neither necessary nor sufficient. The matrix defines required results, not 48 separate commands or repeated review assignments. Such evidence does not replace inspection of the current surface or semantic review of its claims. A new or changed advertised detection capability requires its applicable qualification. An adopter does not rerun an unchanged checker’s entire suite for each audit.
Scope and Claim Boundaries
ID | Required result | Normative source | Required Lean-specific verification |
|---|---|---|---|
| Every normative requirement concerns Lean, dependent types, proofs, elaboration, modules, or a Lean-code claim. |
Read every normative | |
| Prose states no result stronger than the exact Lean declaration it cites. | For every material claim, record the elaborated type, all quantifiers and hypotheses, and compare them with the prose conclusion. | |
| A theorem about a model is not presented as a theorem about an unrelated implementation, runtime, or external system. | Identify the exact model and implementation definitions. For distinct objects, require a checked relation sufficient to transfer the claimed property; reuse definitional equality or existing evidence where it suffices. State the external execution assumptions separately; otherwise narrow or remove the claim. | |
| Universal rules are technical Lean rules, not arbitrary style or application-domain policy. The style, naming, and documentation-form baseline is the Lean community's, adopted by requiring its linters, not restated as rules. | For each universal rule, identify the precise type, proof, elaboration, resolution, module, or computation consequence. Confirm that the style, naming, and documentation-form requirements are the community's own linters (§6.7) and its guides, not conventions restated as rules of this standard. | |
| The object and kind of every material claim are clear: abstract mathematical, executable Lean definition, refinement/correspondence, or external/effectful boundary. Combined claims keep these scopes distinct. An unresolved execution path or a partial surface presented as whole-application coverage blocks the affected claim. |
Enumerate the claimed surfaces and material claims. Reconcile the executable roots and boundary accounts under |
Dependent Types and Lawful APIs
ID | Required result | Normative source | Required Lean-specific verification |
|---|---|---|---|
| Each unary admitted-value invariant is enforced intrinsically by default; a justified raw representation has verified admission and every write boundary closing the same invariant. Reachability and relational claims are stated separately. | Inspect the elaborated type and invalid constructor/update terms; for raw representations, inspect the rationale, every admission/write theorem, and how consumers obtain the required proof. Do not apply an intrinsic-value claim to arbitrary raw states. | |
| Every semantic distinction claimed to be enforced by Lean is represented in the interface types or constructors, with its exact scope stated. | Inspect the typed decoding boundary and downstream API. An enumeration restricts the vocabulary but its constructors share one type. Where distinct types, indices, or refinements are claimed to prevent cross-use, check that use is rejected for the intended reason; parsing or validation at admission is permitted. | |
| Totalized operations and restricted domains are described accurately; a restriction appears in the API only when claimed. | Check boundary cases by reduction/theorem and verify the exact hypothesis or subtype required at call sites. | |
| Abstract models express assumptions as parameters, hypotheses, or proof-bearing fields rather than project logical axioms. |
Inspect binders and | |
| Claimed orders, algebras, and other mathematical interfaces provide their laws and reuse matching Lean/Mathlib structures. | Inspect the selected structures, law-bearing instances, or explicit proof assumptions, including laws supplied by stronger instances. Compare the resulting operations and relations with the intended concept and matching Core/Mathlib definitions. | |
| Every claimed abstraction boundary is the boundary Lean actually enforces. | State the client import context. Verify the intended API use succeeds and that each claimed exclusion fails from a separate importing module. Distinguish name resolution, unfolding, construction, and observation; inspect exported constructors, recursors, projections, coercions, operations, and equations. A failed probe establishes only that attempted exclusion. |
Theorems, Proofs, and Non-Vacuity
ID | Required result | Normative source | Required Lean-specific verification |
|---|---|---|---|
| Every material behavior claim presented as established has kernel-checked evidence in a type, proof-bearing construction, or theorem with the exact intended quantifiers, assumptions, and conclusion. | Enumerate prose claims and match each to an elaborated declaration type; unmatched or weakened claims fail. For executable components, inspect explicit proof requirements and their linkage to actual definitions; gate PASS alone does not establish specification adequacy or completeness. | |
|
Every claimed typeclass law follows from proof-requiring fields of the operational class or a required | Inspect the actual primitive law fields, derived theorems, and selected instances. Every primitive obligation must be discharged; every derived guarantee must follow with exactly its advertised hypotheses. Required mixin evidence must be available at the use site; operations alone do not supply it. | |
| Admission and every update establish the claimed invariant by proof-bearing results or the justified raw-boundary contracts; transition/history/resource-use claims have exact proofs, including initialization, preservation, and composition where the claim requires them. | Inspect admission, all writes, consumers, and exact relational theorem statements. Conditional preservation is not admission, functional behavior, reachability, liveness, or latest-state use. | |
| Important claims are non-vacuous at the exact strength claimed; non-vacuity is relative to the claim. | Require inhabitance, joint satisfiability, or reachability proofs according to the actual prose; stronger evidence may discharge a weaker requirement when the implication and any additional hypotheses are established. Do not reject a deliberately conditional, contradiction, or minimal-counterexample theorem for lacking an antecedent inhabitant when only the implication is claimed; when the development establishes that the antecedent is false, require the prose to acknowledge vacuity where it affects interpretation; the implication establishes neither an antecedent witness nor its conclusion unconditionally. | |
| Logical totality, termination, complexity, and native execution are distinguished; each claimed property has evidence about the exact definitions and semantics it concerns. | Inspect recursive definitions and termination evidence. Match additional claims to the exact types, constructions, or theorems establishing them; logical totality alone does not establish complexity or native execution behavior. | |
| Sampled tests and unchecked evaluation do not replace proofs of universal or existential Lean claims. Counterexample search is an optional aid to refutation. |
Reject proof claims supported only by samples, unchecked enumeration, | |
| Material functional contracts state the component’s exact input/output meaning, rejection and normalization behavior, intended updates and frames, state/error composition, and promised fold relation where applicable. Admission completeness is proved when promised. |
Inspect the actual executable definitions and the relations their contracts require. Check intermediate preconditions and the claimed success, error, and effect semantics. Reuse types, construction, library results, or another checked argument; initialization and preservation are required when the chosen argument needs them. Rule out degenerate implementations that violate the promised relation. Where a decision is registered with a kind (§3.8), read its direction from the report: a one-way kind leaves the other direction unclaimed, and the kind is not evidence that the specification is the intended one. The gate checks one part mechanically: every function the project registers with | |
| Stateful safety transfer has checked correspondence over the exact state and transition semantics. The forward-simulation method in §3.9 supplies initialization, finite abstract matching, preservation, and relation-to-concrete implication; another method must prove the same claimed transfer. Observations and liveness are separate claims. | Inspect the transfer theorem’s exact hypotheses, conclusion, and executable linkage. For the forward-simulation method, check every related pair/concrete successor quantifier, the existential abstract match, stuttering semantics, and universal finite-path induction. Check initial-state reachability at the claimed strength and observation granularity. Require separate hypotheses/proofs for any progress, fairness, productivity, or liveness claim; safety alone supplies none. | |
|
A research statement is adequate to its source mathematics, the presented result's status is exactly one of proved unconditionally, proved under explicit binder hypotheses, or open, and an open target is a | Read each material statement back from the elaborated term: quantifier order and dependence, implicit parameters and universes, consequential definitions, notation, coercions, selected instances, totalized operations, and existence/construction/uniqueness/complexity distinctions. Reject strengthened prose or omitted domain assumptions. Keep reduction hypotheses explicit. Exclude intentionally incomplete sketches and adapters from positive surfaces and closed declarations’ dependency closures; a platform-accepted result needs evidence for the actual elaboration environment and foundation. | |
| Every cost claim names its domain — elaboration/search, proof artifact, kernel replay, or native execution — and no speed, tactic name, native result, theorem count, sample, or audit digest is presented as evidence of correctness or foundation strength; a well-founded definition's own axiom set is reported exactly. | For each cost statement, identify its domain and inspect the argument or bounded observation supporting that exact claim. Recursive-step counts alone do not establish wall-clock complexity. Inspect elaborated recursion, produced terms, and exact axiom dependencies as relevant; cost or native output does not replace proof evidence. |
Axioms and Foundation Strength
ID | Required result | Normative source | Required Lean-specific verification |
|---|---|---|---|
|
No owned declaration is a project logical |
Inspect every owned | |
|
No owned declaration depends transitively on | Compute transitive axiom sets for every owned declaration, including proof-valued definitions and instances. Qualification: adversarial hole mutations cover all advertised declaration forms. | |
| Every owned declaration has its exact transitive axiom set reported. An admissible set receives the least permissive logical label containing it; the selected surface profile is an upper bound. Forbidden and compiler-trusting sets are rejected from conforming positive surfaces. |
Compare the computed set with | |
|
No Choice-Free surface depends directly or transitively on | Inspect the transitive sets for the selected surface profile. Qualification: direct and transitive choice mutations fail the Choice-Free claim; a positive Standard-Logical control passes with its exact label. | |
| Native/compiler-generated proof axioms are classified separately and rejected from the conforming positive proof surface; final-environment metadata alone cannot spoof the classification, and retired compiler-trust names have no compiler exception. |
Inspect generated proof axioms and dependent declarations; the compiler-trusting classification requires a name the |
Declaration and Module Coverage
ID | Required result | Normative source | Required Lean-specific verification |
|---|---|---|---|
| Every exact module in each claimed Lake library and every claimed standalone executable root is discovered and elaborated from source in fresh root-package build state, warning-free, under the declared exact elaboration environment with the community linters of §6.7 enabled, with completed owned logical declaration and dependency admission under §7.3. |
Read the elaborated Lake library module arrays and executable roots. Import every claimed module and reconcile exact attribution and additional root-owned imports. Record toolchain and dependency source state, the identity the result is bound to; reject emitted warnings and stale root-package artifacts. Dependency artifacts may be reused under §7.3. The | |
| Every constant in every owned module is inventoried; proof-valued definitions and instances are not omitted. |
Compare environment constant counts and exact names; classify | |
| Ownership uses Lean/Lake semantics. Generated-role exceptions require independent evidence: regeneration by Lean's own recursion compiler and the kernel's check of the base's recursion equation for recursive helpers, exact structural comparison with the kernel eliminator and pinned constructor-index generator for constructor-index wrappers (§7.4), and native replay with fresh-frontend command provenance for native-proof axioms (§7.5); names or forgeable final metadata alone cannot authorize them. |
Inspect ownership and every claimed exception. Qualification: exact-prefix lookalikes, private and auxiliary-looking names, native-name spoofs, custom-command | |
| Missing/malformed manifests, unknown metadata, omitted declarations, and unexpected project modules fail closed. | Validate the manifest and report schemas and reconcile targets, modules, and declarations. Qualification: mutate each advertised configuration/coverage failure independently and require its intended diagnostic, including observer-command collisions. |
Lean Computation and Evaluation
ID | Required result | Normative source | Required Lean-specific verification |
|---|---|---|---|
|
| Inspect metadata and axiom sets; check representative reduction/evaluation behavior on the pinned toolchain. | |
|
Partial and unsafe declarations are excluded from positive proof surfaces, except for the range-less partial helper of a safe recursive |
Inspect | |
|
Every boundary in the §7.6 conservative execution closure has its exact kind and correspondence state reported; retained compiler edges are distinguished from candidates and historical choices. In | Reconcile all executable roots and their closures, retained IR, supported histories, boundaries, and exact admitted correspondence proofs over the full dependent domain and universes. Qualification covers legitimate and insufficient equalities, imported/chained/both-order replacements, local and overwritten histories, inlined targets, extern/unsafe/partial paths, and cycles or unsupported histories. A definitional comparison the kernel could not complete is unresolved, never trusted; only a completed negative comparison without another admitted proof leaves a replacement trusted. Observing a diagnostic target in emitted code qualifies discovery, not compiler or external-code correctness. Review that the reconciled executable roots are the intended ones. | |
| Transfer from a Lean reference definition to a replacement requires sufficient checked correspondence. Keep remaining trust assumptions for native and external execution explicit. | Compare each theorem’s exact statement and dependencies with the claimed computation and admitted relation. A relation between Lean definitions does not itself verify external machine code or discharge reached extern/native boundaries. |
Opt-in Enforcing Build Integration
These rows apply when the §7.11 build-enforcement claim is made. The other applicable rows remain required for full conformance; a build-linter PASS alone does not discharge them.
ID | Required result | Normative source | Required Lean-specific verification |
|---|---|---|---|
|
The documented enabled ordinary |
Run the enabled ordinary build or | |
| Declared profiles are transitively enforced, with classical erased proofs permitted under Standard-Logical and executable promises checked separately. | Inspect current profile and execution results separately. Qualification: all three positive profiles, direct/imported choice and configuration-change failures, a classical-contract positive, and noncomputable witness rejection. | |
| Required executable evidence inhabits the exact predicate of the actual named implementation, and registered private/imported roots retain execution coverage. |
Inspect registered predicates, proof-bearing construction, and actual callers. Reconcile additional private/imported roots and review specification adequacy. The gate checks mechanically that every function registered with | |
| Cached modules and changed configuration cannot reuse a stale policy verdict; exact claimed Lake coverage and supported-context limits are explicit. | Inspect target/job dependencies and the current manifest and report. Qualification covers unimported glob modules, unclassified targets, imported source and cached profile/execution changes, repeated cached failures, and fresh restoration. Incremental evidence does not establish fresh-source conformance. |
Documentation as a Lean Teaching Surface
ID | Required result | Normative source | Required Lean-specific verification |
|---|---|---|---|
| Public declarations supporting material normative claims have docstrings stating their formal purpose, relevant assumptions, result, and invariant boundary; every other public definition has a docstring; every claimed module documents its material declarations and assumptions. |
Compare the documented claims with elaborated types, definitions, and supporting contracts; a function type alone need not specify its input/output relationship. Check actual module docstrings in owned modules; RG5001 checks that each is present and is the first command after the imports (§5.3). RG2006 checks that every claimed target enables | |
| English explanations of normative Lean statements faithfully convey their quantifiers, hypotheses, conclusions, relevant definitions, and limitations, and identify the authoritative Lean declaration. Each public declaration supporting a material normative claim carries a nonempty labelled Intent section in its docstring. | Read the explanation with its referenced definitions; check quantifier order and dependence, domains, hypotheses, conclusion, and limits affecting interpretation. Distinguish results proved without additional hypotheses, results proved under explicit hypotheses, and open targets, retaining stated domains and foundations. Locate the supporting declaration (including through an attached docstring), and compare its elaborated meaning and its explanation with the written intent statement, the requirement-side record of the intended mathematics or program specification. Section presence is mechanical; adequacy of the intent and agreement with it are semantic review. | |
|
Every Lean fence in the normative documentation tree (here every | Recursively scan the complete normative tree. Qualification mutates every malformed marker/fence state specified in §7.7. | |
| Every positive Lean fence elaborates exactly as printed, warning-free, then passes owned logical admission and declaration/axiom classification. | Elaborate raw source first; inspect the elaborated temporary module without injecting imports into the claimed source. The shipped fence checker uses Standard-Logical; narrower foundation or execution claims require separate evidence. | |
| Every negative fence fails for its non-empty expected diagnostic, and trusted-compiler teaching fences are classified but never counted as conforming. | Require a completed diagnostic-worker result and the whole pattern within one effective-error message, preserving multiline text and rejecting cross-message or informational matches. Inspect trusted declarations and their generated axioms. |
Checker Implementation Qualification
ID | Required result | Normative source | Required Lean-specific verification |
|---|---|---|---|
| A checker that classifies foundation profiles has positive controls for all three profiles through its actual detection implementation, with public-path qualification as required by §7.8. | For new or affected foundation-classification behavior, exercise the relevant positive profiles through the actual detection path; retain applicable evidence for other profiles. | |
| A checker implementation has an independent intended-reason mutation for every violation class it advertises. | Select intended-reason controls for affected advertised capabilities under §7.8. A complete-campaign claim additionally requires its complete applicable manifest. Reject masked or wrong-reason failures. | |
| A checker qualification harness cannot overwrite positive sources or leave stale Lean artifacts, and its restored control passes fresh. | In a qualification run, use unique disposable paths/build state; verify red mutation and fresh restored green. | |
| Checker qualification establishes a fresh warning-free configured-module baseline and keeps mutation artifacts from satisfying restored controls. | In a qualification run, use empty or isolated root-package output and reject every emitted warning. Share the unchanged baseline where valid; mutations may use isolated incremental rebuilds, with fresh restored controls under §7.8. | |
| When separate serialized-graph checking is claimed, the exact claimed module graph is rechecked in a compatible fresh checker state. | Require successful results for every selected root. Reconcile the union of claimed modules in their import closures with the exact Lake inventory. Qualification covers root selection and additional-module coverage. Distinguish the driver’s incremental artifact build from its fresh checker state; it does not establish fresh-source elaboration. |
Result Rule
A conformance conclusion MUST identify the audited surfaces, cite this matrix by ID, and state one terminal result:
-
PASS: every applicable row has sufficient Lean-specific evidence;
-
FAIL: at least one row is violated; or
-
INCOMPLETE: no violation has been established, but required evidence is missing, unknown, skipped, unsupported, timed out, or still running.
When a violation and missing evidence coexist, report FAIL and identify both. A scoped review may report findings and evidence for selected rows, but it MUST state that scope and MUST NOT present those results as full conformance.
Applicability is determined only by the Lean-specific condition stated in the row, not by project preference. INCOMPLETE is not partial compliance and cannot support a conformance claim.