Skip to content

Fix proof-length counter including unrelated declarations - #712

Open
loefflerd wants to merge 5 commits into
LeanPool:mainfrom
loefflerd:CI-theorem-lines
Open

loefflerd wants to merge 5 commits into
LeanPool:mainfrom
loefflerd:CI-theorem-lines

Conversation

@loefflerd

@loefflerd loefflerd commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

The 200-line proof-size check currently treats everything up to the next theorem or lemma as part of the preceding proof. Consequently, a two-line proof followed by definitions or instances can be reported as hundreds of lines long. It also mistakes assignments in theorem statements for the start of the proof.

This change replaces the existing Python-based parser with a Lean linter, enforcing the same 200-line maximum but using Lean's own syntax trees to reliably count lines.

No mathematical content or project metadata is changed.

@github-actions

Copy link
Copy Markdown
Contributor

Proof profile (new / modified Lean files)

No added or modified Lean files under LeanPool/ in this PR. No compile-cost measurements are needed.

Advisory only — never blocks merge.

@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict.

RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; the previous finding is fixed and no new actionable issues were found.

Summary

Replaces the Python proof-length scan with a Lean compiler plugin.

  • Lean counts proof lines from each proof's actual source span.

Reviews (5) · Last reviewed commit: "avoid long functions in long proof test" · Reviewed by Greptile

Comment thread python/lean_pool/quality.py Outdated
Comment thread python/lean_pool/quality.py Outdated
Comment thread python/lean_pool/quality.py Outdated
@loefflerd

Copy link
Copy Markdown
Author

Aargh. It looks like this proposed Python script change just exchanges the quirks and corner cases of the existing script for a different set. Probably the only tool that can reliably parse Lean code is Lean itself; I'll look into writing a Lean proof-length linter (analogous to the existing line-length linter).

@loefflerd
loefflerd marked this pull request as draft October 24, 2026 07:59
@loefflerd
loefflerd marked this pull request as ready for review October 28, 2026 06:36
Comment thread python/tests/test_proof_length_linter.py Outdated

This branch has not been deployed

No deployments
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