chore(lean): clear the 106 linter warnings from the build - #14
Merged
Merged
Conversation
Every `lake build` replayed cached diagnostics for 15 modules, which read as a recompile even though nothing was rebuilt. The build now prints a single line. Mechanical: 76 unused `simp` arguments dropped, 6 `simpa ... using e` narrowed to `simp`, 5 unreferenced binders `_`-prefixed, 5 dead `first` alternatives removed, 4 `<;>` narrowed to single-goal form. Three sites needed a different fix than the linter suggested: - SemanticsCheck: `try (rw [pow_two]; exact hsq.symm)` (x5). The `exact` is load-bearing -- it makes the `try` roll back when `rw` leaves a goal -- so `try rw [pow_two]` broke two goals. Dropping the line outright works; the `rw [pow_two, hsq]` / `rw [hsq]` / `ring` cascade below picks those goals up. - SemanticsCheck and CnotMinProof: `<;>` -> `;` fails with 'No goals to be solved', since the left tactic closes every goal in one branch and `;` errors where `<;>` no-ops. Used `all_goals` for the follow-up.
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.
Why
Every
lake buildreplayed cached diagnostics for 15 modules. Nothing was actually recompiling —Replayedmeans Lake found the cache valid and re-printed the warnings stored from the last real compile — but 106 warnings scrolling past on every invocation reads like a rebuild.Before:
plus 106 warnings.
After:
lake exe tzap-leanis likewise silent before the program's own output.What changed
15 files, +88/−96. No
sorry, no change to any statement — only to the tactic scripts proving them.simpargs dropped fromsimp/simp onlylistssimpa … using e→simp […]where simp closed it alone_-prefixed (hC,hrange×3,hd)firstalternatives / never-executed tactics removedtac1 <;> tac2→ single-goal formThree places the linter's suggestion was wrong
Each of these was applied, failed the build, and then fixed a different way:
SemanticsCheck—try (rw [pow_two]; exact hsq.symm)(×5). The linter flagsexact hsq.symmas doing nothing, and it never does close a goal — but it is load-bearing: it makes the surroundingtryroll back whenrw [pow_two]leaves a goal behind. Rewriting totry rw [pow_two]keeps the rewrite and broke two goals. Deleting the line outright works, because thetry (rw [pow_two, hsq])/try rw [hsq]/try ringcascade below it picks those goals up.SemanticsCheck:1184andCnotMinProof:234—<;>→;. Fails with No goals to be solved: the left tactic closes all goals in one branch, and;errors on zero goals where<;>no-ops. Usedall_goalsfor the follow-up instead.Two notes for anyone repeating this pass:
SemanticsCheck.lean:98neededmap_one, map_negchecked together.simp []was normalized tosimp.Merge.lean:142legitimately keepssimp only [] at hb'— both its args were unused, but the call still reduceshb'.Verification
lake buildexits 0 with zero errors and zero warnings; a second invocation is a clean no-op in ~1.3s.