Zulip Chat Archive
Stream: mathlib4
Topic: Linter for overly specific typeclass assumptions?
Geoffrey Irving (Feb 04 2024 at 19:42):
Say I write a lemma for variables in a LinearlyOrderedField
, but actually the same lemma and proof works if we weaken the hypotheses to LinearlyOrderedSemifield
. Is there a linter that can notice mistakes of this type?
Eric Rodriguez (Feb 04 2024 at 19:43):
@Alex J. Best made such a linter in lean3, not sure if it's ported
Yury G. Kudryashov (Feb 04 2024 at 19:48):
Most probably, no.
Kim Morrison (Feb 04 2024 at 21:59):
Talk, paper, but I can't actually find the code right now. I definitely ran it myself in mathlib3 days, so it was usable by other-than-Alex.
I'm pretty sure that if someone wanted to port/rewrite this for Lean 4 everyone would be happy.
Alex J. Best (Feb 04 2024 at 22:01):
https://github.com/alexjbest/lean-generalisation is the code. I would be very happy to assist someone in porting / rewriting a simplified version to Lean 4 for example (with the idea that a simple version might be more useful (less false positives)).
Alex J. Best (Feb 04 2024 at 22:02):
I don't really have time myself to write a port right now, as much as I'd love to. It really isn't all that complicated though (especially if you have an ok DAG library already)
Geoffrey Irving (Feb 04 2024 at 23:49):
Cool that this at least used to exist!
Last updated: May 02 2025 at 03:31 UTC