Zulip Chat Archive
Stream: mathlib4
Topic: HasCompl for Finsets?
Michael Stoll (Oct 20 2024 at 13:57):
It appears that there is no HasCompl
instance for Finset
s in Mathlib:
import Mathlib
variable {α : Type*} [Fintype α]
-- failed to synthesize HasCompl (Finset α)
#synth HasCompl (Finset α)
Is this by design or just an omission? @Yaël Dillies
Yaël Dillies (Oct 20 2024 at 13:58):
You are missing [DecidableEq α]
Michael Stoll (Oct 20 2024 at 13:58):
OK, silly me...
Kevin Buzzard (Oct 20 2024 at 14:01):
We need a bot to post "did you forget DecidableEq
?" every time someone asks a question about finsets which doesn't mention it anywhere :-) (I am also guilty of this).
Yaël Dillies (Oct 20 2024 at 14:03):
Am I not already that bot? :innocent:
Kevin Buzzard (Oct 20 2024 at 14:07):
Actually we need a bot to write bundled nonconstructive finiteness :-) (plus the 5000 lines of API)
Ruben Van de Velde (Oct 20 2024 at 15:06):
5000 sounds like a very low guess
Eric Wieser (Oct 20 2024 at 15:09):
More realistically, changing lean to say "I tried $instance_in_mathlib but it needed DecidableEq
which I couldn't find"
Kevin Buzzard (Oct 20 2024 at 15:24):
We'd have to avoid getting thousands of "I tried TopologicalRing.toRing but nobody ever mentioned topology", which is tried and fails probably many thousands of times in mathlib.
Eric Wieser (Oct 20 2024 at 15:31):
This has been discussed before; we could tag instances on whether they make sense to warn about in the message. For Finset.instCompleteLattice, this is always something sensible to warn about
Eric Wieser (Oct 20 2024 at 15:31):
(this doesn't require a change to the search algorithm, just to the error message generation)
Last updated: May 02 2025 at 03:31 UTC