-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive from the unusedHavesSuffices linter #428
Comments
There is a suggested workaround at https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.236582/near/385294834 |
For anyone like me passing through, wondering what the linter is seeing, the issue is that once I might be inclined to say that this should be upgraded to a core issue. Maybe equation lemmas should erase unused |
Yes please! The problem is that the type of the equation lemma itself violates the linter, although it may or may not have actually been generated in the given file, and theorems that use the lemma will also end up violating the linter because the type of the equation lemma shows up in various places during rewriting. |
Upgrading to a core issue would require further minimizing the example. If anyone has the time and inclination to do so, that would be much appreciated. Either posting a smaller example here, or just directly opening a new issue on core would work! |
This linter was silently not doing anything until leanprover/lean4#4410 was fixed, and now it is working so a backlog of warnings needed to be addressed. Some were addressed here: #13680. The warnings in this PRs are false positives (leanprover-community/batteries#428?), but a workaround is put in place. Co-authored-by: L Lllvvuu <[email protected]>
The import Batteries.Tactic.Lint.Misc
import Batteries.Tactic.Lint.Frontend
def Nat.log (b : Nat) : Nat → Nat
| n =>
if h : b ≤ n ∧ 1 < b then
have : n / b < n := div_lt_self (by omega) (by omega)
log b (n / b) + 1
else 0
#print Nat.log
#print Nat.log.eq_1
theorem Nat.log_eq_zero_iff {b n : Nat} : log b n = log b n := by
rw [log]
#lint only unusedHavesSuffices |
This linter was silently not doing anything until leanprover/lean4#4410 was fixed, and now it is working so a backlog of warnings needed to be addressed. Some were addressed here: #13680. The warnings in this PRs are false positives (leanprover-community/batteries#428?), but a workaround is put in place. Co-authored-by: L Lllvvuu <[email protected]>
Somehow when we
rw [go]
, theunusedHavesSuffices
linter can see thehave
statements from inside thego
, and doesn't like them. This is from leanprover-community/mathlib4#8885The text was updated successfully, but these errors were encountered: