Skip to content

doc: document how to write and check a comparator challenge - #988

Closed
Deicyde wants to merge 1 commit into
leanprover:mainfrom
Deicyde:comparator-guide
Closed

Deicyde wants to merge 1 commit into
leanprover:mainfrom
Deicyde:comparator-guide

Conversation

@Deicyde

@Deicyde Deicyde commented Oct 31, 2026

Copy link
Copy Markdown

This PR documents how to set up and interpret lake comparator, and removes the manual's links to the archived leanprover/comparator repository. That repository's README was the only explanation of parts of this material, and comparator's behavior now needs a home that is versioned with Lean.

Additions to "Challenges and External Checkers":

  • Writing a Challenge: the setup steps and guidance, based on Yaël Dillies' leanprover/comparator#100.
  • What Is Compared: the checks in order, written from Lake/Check/Compare.lean and Lake/CLI/Check.lean.
  • Definition Holes: what is and isn't checked, and how these challenges can be gamed, from the old README.

Changes to "Validating a Lean Proof":

  • The Trust section now lists the assumptions from lake help comparator on master (lean4#16096), plus a line on reviewing definition holes.
  • The Comments section now mentions --paranoid instead of saying nanoda is the only external checker.

Testing:

  • I couldn't build the manual locally, so this CI run will be the first full build, including the new markup and cross-references.
  • The Lean examples compile with lean on v4.36.0-rc2 outside the manual. In the manual, they are checked by the build.
  • I haven't run lake comparator on these examples, because it needs Linux and bubblewrap and I only had a Mac. The claims that the solutions are accepted come from the old README and from reading Compare.lean.

Questions for reviewers:

  1. Is this the right scope? CONTRIBUTING.md asks to discuss substantial content first, so this is a draft for that discussion. I can split it up or cut it down.
  2. How should Mathlib projects meet the clean-build assumption? lake help comparator on master requires no existing .lake directory, while the archived README allowed lake exe cache get beforehand if you trust the cache. A Mathlib project may otherwise have to build Mathlib from source. This PR doesn't address it because I couldn't find it documented.
  3. Should the assumptions and hole behavior wait for a newer toolchain? The assumptions list is in lake help on master but not v4.36.0-rc2. The check that holes are sorry in the challenge (lean4#15775) isn't in rc2 either, so the text tells authors to use sorry without saying that anything else is rejected.
  4. Should the internals be documented further? I left out the old README's sandbox-by-sandbox description, since it was tied to landrun, and the note on why .olean files aren't loaded, which the lake comparator entry already covers.

Overlap: #982 adds a chapter on external kernels, so the Comments edit could link to it once that lands. #847 also edits "Validating a Lean Proof", so one of these may need a small rebase.

This PR was drafted with generative AI (Claude Code).

🤖 Generated with Claude Code

The archived leanprover/comparator README was the only explanation of how to
set up a challenge, what is compared and how definition holes can be gamed.
Move that material here, updated for `lake comparator`, along with the
assumptions the result relies on, and stop linking to the archived repository.

Based in part on leanprover/comparator#100.

Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Deicyde Deicyde closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant