RFC: evaluator-owned accepted statements for conditional Comparator matches
Proposal
Add an optional accepted_statements_file setting to lake comparator for evaluating proofs that are conditional on an explicit, evaluator-owned set of mathematical statements. Preserve the original axiom policy and check the original conditional proof with every configured kernel. Report the exact accepted statements required by each theorem and return a distinct exit code, 3, for a conditional match.
User experience and motivation. A third-party evaluator may want to check a submitted derivation that relies on a substantial mathematical result whose Lean proof is unavailable or would take disproportionate effort to formalize. For example, a benchmark can fix a challenge T and approve statements A and B, then evaluate a submission proving A -> B -> T. The result should identify the dependency on A and B, while retaining kernel checking of the submitted derivation and the evaluator's ordinary permitted-axiom policy. Defining the approved propositions does not assert them as custom axioms or manufacture an unconditional proof.
Beneficiaries. Independent proof-evaluation services, benchmark runners, and formalization databases can distinguish an unconditional solution from a verified reduction to explicitly approved statements. Projects can also use this during their own development. For third-party evaluation, the challenge and approvals must have meanings fixed independently of the submitted project's modules, definitions, notation, instances, and build configuration.
The proposed contract is:
- The setting names a JSON array of declaration names, resolved relative to the evaluator's configuration. Each entry must identify a safe, closed, monomorphic definition of type
Propin the evaluator's reference export. Accepted statements cannot themselves be theorem targets or definition holes. - Additional hypotheses must be leading and nondependent. Each must exactly match an approved declaration, its exported body, or a nested conjunction of approved inputs. General logical equivalence, quantifier instantiation, and disjunction are not inferred.
- Compare the used premises and their transitive definitions without theorem-target or definition-hole exemptions, then compare the remaining challenge statement using Comparator's existing rules. A submission that changes an approved proposition to
False, or changes a fixed dependency of the challenge fromFalsetoTrue, is rejected. Existing evaluator-selected definition holes elsewhere retain their current semantics. - Check the original solution's axioms and proof, and the approved definitions' axiom dependencies. Report approval names per theorem in first-occurrence order without duplicates. The report describes hypotheses in the theorem's type, including hypotheses its proof does not use.
- Return
0when all checked targets match unconditionally,1for rejection,2for configuration/startup errors, and3only when all checks pass and at least one target matches conditionally. This gives evaluation pipelines an explicit way to handle conditional results without parsing prose or counting them as unconditional successes.
Independent evaluator authority. Whenever the option is present, require --challenge-from-export from a separately built, evaluator-controlled workspace. Require the configuration, approval list, and reference export to resolve outside the submitted project, including through symbolic links. Read the configuration and approvals and parse the reference before running any submitted Lake configuration, dependency resolution, build, or exporter; retain the reference in memory. The submitted project's same-named modules or approval files cannot define the evaluator's reference.
Sandboxed source evaluation uses fresh private storage mounted at .lake, hiding submitted caches and hard links, and rejects a symbolic link replacing .lake. Evaluator inputs remain outside the writable storage. Third-party source evaluation requires real Linux bubblewrap and a trusted toolchain and environment; --inadvisably-no-sandbox is only suitable for trusted code. The evaluator remains responsible for the provenance, truth, and consistency of approved statements. File placement and structural comparison cannot establish those facts.
Maintainability and cost. The implementation extends the existing comparison, axiom-checking, export, and kernel paths. No approved statement is injected as an axiom, and no new proof checker is introduced. Omitting the setting preserves existing behavior; lake check is unaffected. Fresh private build storage rebuilds dependencies and artifacts for each source evaluation. Supplying a solution export is also supported and retains the same comparison and kernel checks.
The proposed implementation includes command-help and README documentation, semantic regressions, and a separate-workspace suite using real bubblewrap. The latter checks conflicting project definitions, a project-owned approval list, direct and symlink-based tampering, hidden caches and hard links, and invalid evaluator input locations. Attack markers, a successful private write, and before/after protected-file hashes are required so that an unexecuted attack cannot count as a passing isolation test. The validation run passes the Lake build, strict core compiler linters for all three feature modules, and all 26 relevant suites, with no skips; its feature source tree matches the reviewed branch, with the validation workflow as the only additional file.
Community Feedback
No public Zulip discussion is linked yet. Feedback is requested on the scope of exact accepted hypotheses, the independent-reference interface, and the separate conditional exit status. The implementation is available in draft PR #15801, which remains draft pending developer approval of the proposal.
The submitter has manually reviewed the changes. Implementation, documentation, tests, and this proposal were developed with OpenAI Codex assistance.
Impact
This would let third-party evaluators recognize useful conditional formalizations while retaining a fixed challenge, explicit assumptions, and kernel-checked submitted proofs. Consumers can keep conditional and unconditional results separate using the exit status and per-theorem assumption report.
Please add a thumbs-up reaction if this proposal would benefit your evaluation or formalization workflow, and describe relevant use cases or constraints in the discussion.
For context, the actual issue that prompted me to make this issue/PR is that I made a formalization for Erdos problem 690 at https://github.com/kimihiro64/erdos-690-prime-factor-unimodality, but evaluators like lean-eval, mathdb etc. have defined challenge statements that are unconditional (for good reason). That formalization boils down to 1 conditional input, which is an unconditionally proved estimate by Dusart that requires checks against billions of zeta zeroes and a completeness argument that are computationally feasible but not inside of Lean. This feature would allow their comparator to pass if they added a file verifying Dusart's published estimate as an accepted conditional input, without having to maintain multiple copies of a challenge statement based on what someone may be able to come up with for every various formalization. And it feels conceptually better than allowing a bunch of custom axioms.
If a formalization is conditional, then why not add that condition as an assumption?
3. If a formalization is conditional, then why not add that condition as an assumption?
There are two different types of conditional statements, right? For instance, you can formalize something assuming RH or some other unproven statement. Or you can formalize something assuming a statement you can't currently formalize, even though it's a commonly accepted statement. In either case, if something like lean-eval has an open problem, their current problem statement is unlikely to have a bunch of versions that may include all possible conditional formalizations, they only want to define that once. This allows a way to build a library of accepted statements, so that the single challenge statement can be conditionally matched with comparator using any number of accepted statements. Which separates the concept of 'formalized but conditional on an unproved statement' and 'formalized but conditional on a statement we accept is mathematically true but not formalized'. I don't expect that Dusart's various estimates relying on billions of zeta zero verifications are going to be feasible in Lean anytime soon, maybe ever on github runner resources, but it doesn't make sense to throw up our hands and say an entire problem isn't successfully formalized just because one input can't be. And I don't think adding it as an axiom and requiring challenge statements to include that axiom and evaluators to accept that axiom is a good solution either. Hence this PR.
And I don't think adding it as an axiom and requiring challenge statements to include that axiom and evaluators to accept that axiom is a good solution either.
You have not given any reasoning for this part yet. An unproved theorem is equivalent to an axiom so the need for a new comparator feature is unclear. In any case, this is something probably best discussed with the main intended users such as lean-eval first.
5. > And I don't think adding it as an axiom and requiring challenge statements to include that axiom and evaluators to accept that axiom is a good solution either.
You have not given any reasoning for this part yet. An unproved theorem is equivalent to an axiom so the need for a new comparator feature is unclear. In any case, this is something probably best discussed with the main intended users such as lean-eval first.
A conditional match to a challenge statement seems useful regardless of the evaluator usecase, and whether it's an axiom or kept separate as actual conditionals is a matter of choice/preference, but I think most would prefer to keep their project axiom free and have a conditional proof, it keeps the challenge statement clean and the separate exit code and output make it clear it's conditional and on what.
Thanks for explaining but as this is effectively all covered by axioms and would only mean a minute change in presentation, I don't think there is anything to be done here
7. Thanks for explaining but as this is effectively all covered by axioms and would only mean a minute change in presentation, I don't think there is anything to be done here
By that logic, you should just rip out conditional proofs from Lean because it's "all covered by axioms", right? There's a clear use case for supporting conditionals, and if you ever go on the Lean Zulip, they'll adamantly say you shouldn't just axiom something because you can't formalize it. A conditional proof is entirely true, whether the thing it's conditional on is true or not. Bringing in axioms makes it messy, especially when using AI, because you have to trust they're only going to apply it exactly where you want to. And there's a very high probability these computational results will just never get formalized because of the scale and Lean's much slower kernel checking, even with native decide some of these can be days.