Zulip Chat Archive
Stream: mathlib4
Topic: linter.unusedSimpArgs misfiring
Bhavik Mehta (Jul 10 2025 at 23:49):
The unusedSimpArgs linter sometimes fires in cases where the simp argument is used and necessary. Here's an example:
import Mathlib.Algebra.AddTorsor.Defs
import Mathlib.Algebra.Group.Pointwise.Finset.Scalar
open Pointwise
example {α β : Type*} [AddCommGroup α] [DecidableEq α]
{S : Finset α} (n : α) {χ : α → β} :
(∀ k : β, ∃ i ∈ n +ᵥ S, χ i = k) ↔ Set.SurjOn χ (n +ᵥ S) Set.univ := by
simp [Set.SurjOn, Set.subset_def, ← Finset.coe_vadd_finset]
Is this something we can fix?
Jovan Gerbscheid (Jul 11 2025 at 03:37):
I think that the simp lemma ← Finset.coe_vadd_finset is actually not used in the final proof term. But removing it still somehow breaks the proof?
Damiano Testa (Jul 11 2025 at 04:12):
It looks like it suffices to have ← Finset.mem_coe._simp_1, so maybe the lemma brings in some "erased" declaration?
Damiano Testa (Jul 11 2025 at 04:12):
Maybe, simp generates a list of "extra" lemmas from the list that you give, those lemmas are used in the final proof term, but not the original one, and the linter gets confused.
Jovan Gerbscheid (Jul 11 2025 at 04:14):
Ah, that's it! The forward lemma is erased from the simp set, so we have to replace it with - Finset.coe_vadd_finset
Damiano Testa (Jul 11 2025 at 04:18):
So, you really have to "remove it with a -", not just erase it! :lol:
Last updated: Dec 20 2025 at 21:32 UTC