Skip to content

chore(QuantumInfo): clear 56 files from the linter exemption list#1244

Open
tracyphasespace wants to merge 1 commit into
leanprover-community:masterfrom
tracyphasespace:cleanup/quantuminfo-exemptions
Open

chore(QuantumInfo): clear 56 files from the linter exemption list#1244
tracyphasespace wants to merge 1 commit into
leanprover-community:masterfrom
tracyphasespace:cleanup/quantuminfo-exemptions

Conversation

@tracyphasespace

Copy link
Copy Markdown
Contributor

What

Removes 59 of the 84 QuantumInfo/ files from scripts/LinterExemption.txt by making each
pass lake exe runPhyslibLinters and scripts/lint-style.py. Changes are docstrings
(module + declaration/notation), line-wraps to ≤100 chars, resolved non-terminal simp, and a
small number of safe code-level fixes: removing @[simp] from lemmas the linter reports as
simp-provable, and deftheorem where flagged. No proof bodies were weakened.

Verified by a full QuantumInfo build (Lean v4.30.0): runPhyslibLinters reports
-- Linting passed for QuantumInfo, and lint-style.py is clean on every de-exempted file.

Integrity: the 59 de-exempted files add no sorry, no axiom, no admit, no
set_option … false
, and contain no pre-existing sorry (files that still had sorry were
intentionally left exempted — see below). One disclosed mechanical choice: Channels/Bundled.lean
uses attribute [nolint docBlame] on 4 auto-generated multi-parent projections that cannot take
doc-strings without breaking projection inference.

This supersedes #1224 (that single-file change is included here).

The 25 files left exempted (with suggested paths)

Documented so the cleanup isn't silently blocked:

  • 6 exceed the 1500-line cap (Relative, LownerHeinzCore, SteinsLemma, Matrix, CFC,
    MState) — wrapping only grows them past ERR_NUM_LIN; they need a file split or a
    scripts/style-exceptions.txt watermark.
  • 2 don't build on baseline (Entropy/Axiomatized/Defs, ResourceTheory/ResourceTheory) —
    pre-existing compile errors (look rename-induced); need a fix before linting.
  • 8 have unusedArguments with multiple unused instance binders — iterative signature
    surgery best done by someone who knows the intended API.
  • 5 contain pre-existing sorry (Renyi incl. data-processing inequality / Klein, Capacity,
    ClassicalInfo/Capacity, Fidelity, Misc) — genuine proof obligations.
  • 4 are simply unfinished (Inner, FreeState, Qubit, Braket) — tractable follow-up.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for this PR, which will now be reviewed. If submitting to ./Physlib or ./QuantumInfo, please see our review guidelines if you are not familiar with the process. You should expect a back and forth with a reviewer before your PR is merged. See also that link for how to add appropriate labels to your PR. The PR will also go through a number of automated checks. You can learn more about these here, including how to run them locally.

If you are submitting to ./PhyslibAlpha there will be a lighter review process, though your PR must still pass the automated checks.

If you want to bring attention to this PR, please write a message on this thread of the Lean Zulip.

Important: If a reviewer adds an awaiting-author label to your PR, once you have addressed the review comments, please remove that label by adding a comment with -awaiting-author. This helps us keep track of reviews.

@tracyphasespace tracyphasespace changed the title chore(QuantumInfo): clear 59 files from the linter exemption list chore(QuantumInfo): clear 60 files from the linter exemption list Jun 24, 2026
@tracyphasespace

Copy link
Copy Markdown
Contributor Author

Update: now 60 files de-exempted (added ForMathlib/Misc.lean — its only sorrys are inside a /- -/ comment showing example future code; all real declarations are proved, confirmed via #print axioms = no sorryAx). 24 files remain exempted; the "contains sorry" group is now 4 (Renyi, Capacity/Capacity, ClassicalInfo/Capacity, Fidelity).

@tracyphasespace tracyphasespace force-pushed the cleanup/quantuminfo-exemptions branch from 1e51a64 to 924b45c Compare June 24, 2026 13:42
Removes QuantumInfo files from scripts/LinterExemption.txt by making each pass
lake exe runPhyslibLinters and scripts/lint-style.py: module + declaration
docstrings, line-wraps to <=100 chars, resolved non-terminal simp, and a few safe
code-level fixes (drop @[simp] where simp-provable, def->theorem where flagged).
No proof bodies weakened; no sorry/axiom/admit/set_option..false added (audited).
Verified by a full QuantumInfo build (Lean v4.30.0).

Remaining exempted files are documented in QuantumInfo_exemption_cleanup_NOTES.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tracyphasespace tracyphasespace force-pushed the cleanup/quantuminfo-exemptions branch from 924b45c to 1115ffd Compare June 24, 2026 13:53
@tracyphasespace tracyphasespace changed the title chore(QuantumInfo): clear 60 files from the linter exemption list chore(QuantumInfo): clear 56 files from the linter exemption list Jun 24, 2026
@jstoobysmith

Copy link
Copy Markdown
Member

Many thanks for doing this.

Through no fault of yours, I'm struggling a bit with what to do with this PR, for following reason:

  1. For me (or anyone else) to review this properly I would need a fair amount of time, in which other changes will no doubt happen and make some of the changes here redundant.
  2. I also don't think opening around 50 PRs for individual files in one go is a viable solution either.

I think one of the ideas behind the ai-tool is that it produces a PR which is easy to verify/review/check in a very short amount of time, but when they are combined like this it makes it harder to verify.

Maybe starting with 3-4 files would be a good start (either combined, or as separate PRs).

Also a material comment:

I think I know why it is doing this, but we should stop it putting the comment "This can be filled in later" for the table of content.

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.

2 participants