Zulip Chat Archive

Stream: mathlib4

Topic: deriving instances


Joël Riou (Dec 20 2022 at 23:15):

In mathlib4#1132, some instances which were derived in mathlib using the @[derive ...] are no longer found with the new syntax deriving .... Examples are the Category instance for the essential image, and the Full and Faithful instances for the inclusion functor.

Matej Penciak (Dec 21 2022 at 22:59):

It looks like this is used in a bunch of places in mathlib... I can try to define a deriving handler for categories. Is there a place in mathlib3 where @[derive...] is defined? Is it expected that it should always follow from inferInstance?

Scott Morrison (Dec 21 2022 at 23:01):

There is a default derive handler that just dsimps the declaration and then runs type inference. For some reason we either don't have that, or its not firing correctly.

Scott Morrison (Dec 21 2022 at 23:01):

(In particular, there's nothing specific about category in the derive handlers.)

Yaël Dillies (Dec 22 2022 at 08:34):

Also, aren't we getting a problem with the fact that derived instances get the automatic name, which we've decided on not using?


Last updated: Dec 20 2023 at 11:08 UTC