Repository navigation
Reject unexpected primed Lean axiom reports - #3634
Merged
Mister-Meeseeks merged 1 commit intoOct 20, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Lean axiom audit can report
PASS 1 declarationswhile its actual compiler output contains a second theorem depending on a forbidden axiom. Both output regexes excluded apostrophes from names, so a primed name such asbad'was invisible to the report count and axiom checks. A normal audited theorem namedactual'also failed withreported 0/1. Lean permits apostrophes in identifiers; see its identifier syntax.For example, this valid Lean 4.21.0 source compiles successfully and prints both real axiom reports, but the original CLI reports success:
The current source-query reader collects
goodfrom this fixture; the extra primed report must still be rejected by the output checker. Match names through the report delimiter, allowing apostrophes while keeping names within one output line. The existing report count, expected-name set, and axiom allowlist then reject the extrabad'report. The corrected CLI exits 1 and reportscustom; the original exits 0 withPASS 1 declarations.This changes only output parsing and adds a separate regression module. Pending #3602 addresses raw strings in the source-query lexer; that lexer and its tests are untouched here. The two fixes cover complementary boundaries. The selected result, theorem sources, frozen inputs, source maps, and certificates are unchanged. This remains a bounded audit helper, not a complete Lean parser or authentication against arbitrary hostile elaborators or loggers.
Test plan
20ecf2891d80b5acf18d980b2164fb44ea7faa90: the new test module produced 7 failures and 7 errors, including the actual Lean false PASS above and rejection of valid primed declarations.LEAN_AUDIT_BIN=/path/to/lean-4.21.0/bin python3.12 -W error -B -m unittest discover -s tests -p 'test_lean_axiom*.py' -v— all 8 tests passed, including both live Lean test groups.python3.12 -I -O -B ... -q— all 8 tests passed.sorryAx. Every fixture compiles successfully before its audit outcome is checked.git diff --checkpasses.Environment: macOS arm64, CPython 3.12.14, Lean 4.21.0 (
6741444a63ee). WithoutLEAN_AUDIT_BIN, the live tests explicitly skip; the parser controls still run.Attribution and overlap
Retain the helper authors and @ywz65's source-scanner work in #2523. This correction extends the existing output checks independently of @roger-sato's pending #3602 source-lexer fix. Canonical base remains
20ecf2891d80b5acf18d980b2164fb44ea7faa90, priority revision 6. The fresh overlap snapshot covers 344 open PRs, 2,959 closed/merged PRs, and 2,453 Discussions; targeted all-state searches found no equivalent primed-report repair. This is bounded search coverage, not a general novelty claim.Prepared by roger-sato with substantial OpenAI Codex assistance. Apache-2.0.