Skip to the content.

0011: Non-vacuity witnesses on coverage rows

Status: implemented. Author: drafted by the AI operations agent at Le Chen’s request. Created: 2026-11-07. Decided: 2026-11-07, accepted by Le Chen (maintainer of record). Implemented in: 0.28.0 (doi:10.5281/zenodo.24085127), by #437.

Summary

Proposal 0003 added an optional witness to claims: another claim whose Lean type is ∃ over the theorem’s parameters of the conjunction of all its hypotheses. The Lean-side probe checks that type mechanically (the hyp-witness fact of hyp-probe/1), and the ledger records the witness as checked, unchecked or mismatch. Two things keep it from reaching a reader:

  1. A witness is accepted only on a conditional claim (one with hypotheses). The common case, a theorem whose hypotheses are the paper’s own setting, cannot have one.
  2. No page shows a witness. 0003 planned a page line for it (“non-vacuity witness: …”), but it was not built.

This proposal does three things:

It is for package authors who want a reader to see that a verified theorem is not vacuously true, and for the readers of their pages.

Motivation

A Lean theorem whose hypotheses can never hold together proves anything; it is vacuously true. The comparator guide (rule 5) leaves this check to the human reviewer. For a theorem about objects defined in the package, this is the concrete risk. A definition can be wrong in a way that makes it impossible to satisfy: a covariance that is not positive definite, a filtration condition that no process meets, a pair of bounds with an empty range. The theorem then compiles, passes the comparator against a Challenge that uses the same definitions, and says nothing.

Formalizations of whole papers now publish an existence result next to each headline theorem. One public example is a repository of AI-assisted formalizations of random-geometry papers. Its headline result is the conjunction of the two main theorems with “there exists a normalized whole-plane Gaussian free field”, so the field the theorems quantify over is shown to exist. An existing lean-pkg paper companion does the same by hand: it states and proves that “the paper’s setting is satisfiable” (a probability space carrying a space-time white noise and its filtration) as an ordinary claim, which the page lists as just another result.

lean-pkg already has the checking machinery and is missing the two last steps:

Design

claims/1: a witness on any claim with a hypothesis

The rule “witness is set but the claim has no hypotheses” is relaxed. A claim may set witness when its theorem has at least one hypothesis: an explicit or implicit binder of Prop type, the binders that hyp-decl already reports. Listing them in hypotheses is no longer required.

Example:

claims:
  - id: demo/lfpp-converges
    decl: Demo.lfpp_converges          # ∀ γ h, 0 < γ → γ < 2 → IsGFF h → Converges γ h
    kind: theorem
    witness: demo/lfpp-converges-nonvacuous
  - id: demo/lfpp-converges-nonvacuous
    decl: Demo.lfpp_converges_nonvacuous   # ∃ γ h, 0 < γ ∧ γ < 2 ∧ IsGFF h
    kind: theorem

coverage/1: the row names its witness

Paper rows, and the rows of a kind: library file, gain one optional key:

rows:
  - paper: {number: "Theorem 1.1", title: "Convergence of LFPP"}
    class: same-assumptions
    claims: [demo/lfpp-converges, demo/lfpp-converges-sublemma]
    witness: demo/lfpp-converges-nonvacuous

The row key does not duplicate the claim key. The claim key carries the relation the probe checks (this witness, of that theorem). The row key says which of the row’s theorems speaks for the paper result. A row often lists several claims, and only the headline’s hypotheses are the paper’s.

lean-pkg page

For a row with witness, a Hypotheses can be met. line follows the row’s Hypotheses line. Its text depends on the ledger’s witness state for the headline claim:

State Line
checked Hypotheses can be met. Lean proves that some instance satisfies all of them together (WITNESS_DECL, checked by lean-pkg’s probe against the Challenge).
unchecked Hypotheses can be met: claimed by WITNESS_DECL, not yet checked (REASON).
mismatch Hypotheses can be met: the named witness does not have the expected type, so nothing is shown.

--json

Additive only:

No exit code changes. No command or flag is added. The ledger’s codes are unchanged; witness-type-mismatch gains one detail text.

Compatibility and migration

Trust model

What a receipt proves does not change, nor what gate, promote or publish accept. The ledger still decides verified from the receipts. A witness never makes a claim verified or conditional, and a mismatch is already a failed diagnostic today.

What changes is what the page claims, and this time the claim is machine-checked, unlike 0010’s conclusion:

Alternatives

Open questions

  1. Setting-level witnesses. The public example’s witness is “a normalized whole-plane GFF exists”: the existence of the objects, not the exact ∃ γ h, 0 < γ ∧ γ < 2 ∧ IsGFF h. The exact type implies it, so the strict design accepts more information. But should a looser form, the ∃ of a subset of the hypotheses, be accepted and shown with a weaker line (“the objects exist”)?
  2. A coverage check hint (a warning, never an error) for a same-assumptions row whose headline theorem has a hypothesis headed by a package-defined def and no witness: the case where a vacuous definition is most likely.
  3. Instance binders. Should [IsProbabilityMeasure P] and other instance-implicit Prop binders count as hypotheses of the expected witness type? Today hyp-decl reports every Prop binder with a constant head, explicit or not, so they are included. That is right for non-vacuity, but it makes witnesses longer to state.
  4. Library rows. This draft allows the key on library rows, because non-vacuity is a property of the Lean statement and libraries have hypotheses too. Proposal 0010 refused conclusion there, because a library row has no paper to be weaker than. Is the asymmetry right?
  5. Several headline claims on one row. Should the key take a list, one witness per headline, for a row whose paper result is a conjunction proved as several theorems?

AI assistance

Drafted by Claude (Anthropic) at Le Chen’s request. The design builds on the existing claim-level witness of proposal 0003 (its rules in src/lean_pkg/claims.py, the hyp-witness probe fact in docs/formats.md and the ledger’s witness states), and follows the layout of proposal 0010. The motivation comes from a reading of a public AI-assisted formalization repository whose headline results include existence witnesses.