Zulip Chat Archive

Stream: mathlib4

Topic: Setoid as a typeclass


Yury G. Kudryashov (Oct 08 2024 at 23:19):

Hi, I suggest that we change all Setoid _ instances to non-instances and completely migrate away from the instance API.

Yury G. Kudryashov (Oct 08 2024 at 23:21):

First in Mathlib, then ask core team what they think about turning it into a structure so that docs#Setoid.r works fine with dot notation and is pretty printed as Setoid.r s or s.r, not Setoid.r (no arguments).

Yuyang Zhao (Oct 08 2024 at 23:27):

There are some related refactoring attempts in #16210, but none of the PRs have been merged.

Eric Wieser (Oct 08 2024 at 23:28):

Yury G. Kudryashov said:

hen ask core team what they think about turning it into a structure so that docs#Setoid.r works fine with dot notation and is pretty printed as Setoid.r s or s.r, not Setoid.r (no arguments).

We could also use docs#Setoid.Rel, which prints in the way you want

Yuyang Zhao (Oct 08 2024 at 23:31):

#16254 (one of the PRs) would immediately resolve the problem of pretty-printing Setoid.r.

Eric Wieser (Oct 08 2024 at 23:38):

If we do that then we can probably follow on by dropping Rel

Yury G. Kudryashov (Oct 09 2024 at 02:12):

#16260 deprecates Rel

Yury G. Kudryashov (Oct 09 2024 at 02:13):

BTW, I've just delegated #16254

Yury G. Kudryashov (Oct 09 2024 at 02:13):

Are there other leaf PRs in this refactor?

Yuyang Zhao (Oct 09 2024 at 14:10):

#16256 #16258 #16260 #16267 are ready.

Yuyang Zhao (Oct 09 2024 at 14:15):

I'm a little hesitant to change instance parameters to implicit parameters now. If we decide to migrate to QuotLike, we may not have to change these parameters. However, the API in core has been changed and there is not much to fix in these PRs.

Yury G. Kudryashov (Oct 09 2024 at 17:00):

I think that cleaning up is a good thing anyway.

Yuyang Zhao (Oct 18 2024 at 11:08):

#16260 #17594 are ready.

Yuyang Zhao (Oct 19 2024 at 10:26):

#16264 #16410 #17940 #17941 are ready.

Yuyang Zhao (Oct 19 2024 at 19:27):

#16314 is ready.


Last updated: May 02 2025 at 03:31 UTC