Zulip Chat Archive

Stream: mathlib4

Topic: WellOrder class abbrev


Violeta Hernández (Nov 29 2024 at 23:07):

Is there any possibility we could make a WellOrder class abbrev for LinearOrder + WellFoundedLT?

Violeta Hernández (Nov 29 2024 at 23:08):

I feel like this structure is really common, but simultaneously it's not obvious that this is the "correct" way to write it

Violeta Hernández (Nov 29 2024 at 23:08):

Using docs#IsWellOrder often ends up being a bit of a footgun, for all the reasons we don't usually use unbundled relations

Violeta Hernández (Nov 29 2024 at 23:17):

I remember that there was some discussion about using the class abbrev feature but I don't remember if that came to a clear conclusion

Jireh Loreaux (Nov 29 2024 at 23:54):

I think it's really not that common in most of mathematics. You just happen to work on set theory, where it gets used a lot. That being said, I am open to being wrong here.

Violeta Hernández (Nov 29 2024 at 23:55):

Fair enough, "really common" is relative

Violeta Hernández (Nov 29 2024 at 23:56):

There's definitely a bunch of places where this gets used, though

Violeta Hernández (Nov 29 2024 at 23:57):

Are class abbrevs something we're fine with using liberally? Or would this have to be a really common typeclass for it to make sense?

Violeta Hernández (Dec 02 2024 at 07:01):

Or actually, is there any policy on class abbrevs to begin with?

Jireh Loreaux (Dec 02 2024 at 07:34):

I think we avoid class abbrev almost everywhere because it creates instances in both directions, and we suspect that would be bad for performance. At least, I believe @Eric Wieser thinks so.

Eric Wieser (Dec 02 2024 at 07:49):

We could try using it for something prominent like NonUnitalAlgebra and see what the cost is

Eric Wieser (Dec 02 2024 at 07:51):

But yes, my impression is that "Lean 4 can handle typeclass loops" is a simplification that doesn't apply to some of mathlib's more-dependent typeclasses


Last updated: May 02 2025 at 03:31 UTC