Zulip Chat Archive

Stream: mathlib4

Topic: categories with morphisms in Prop


Chris Henson (Jul 02 2025 at 17:16):

Two questions:

  1. Could someone explain the design decision to have docs#CategoryTheory.Category universe polymorphic over Type (as opposed to Sort)?
  2. Given this decision, what is the best way to work with categories whose morphisms are in Prop? It seems the choices are to do some lifting (like in docs#Preorder.smallCategory) or refactor to use Type.

Kenny Lau (Jul 02 2025 at 17:21):

I'm not a developer but I would explain it by saying that Prop is a really "weak" universe and we usually think of morphisms as having "data"

Aaron Liu (Jul 02 2025 at 17:25):

You can always PLift into a type

Yaël Dillies (Jul 02 2025 at 17:27):

Chris Henson said:

  1. what is the best way to work with categories whose morphisms are in Prop?

You should (probably) put a Preorder instance on such a category and use the results in the file Mathlib.CategoryTheory.Category.Preorder

Joël Riou (Jul 02 2025 at 17:41):

Note: a few people (not me) have tried to allow morphisms in categories to be in Sort v instead of Type v, but it failed because of subtleties about universes in Lean.

Chris Henson (Jul 02 2025 at 17:46):

Yaël Dillies said:

You should (probably) put a Preorder instance on such a category and use the results in the file Mathlib.CategoryTheory.Category.Preorder

This is interesting. The context here is that my morphisms are typing derivations (for various locally nameless formalizations of lambda calculi I've done). So it feels a bit odd to define a preorder on them, but maybe this is the best way to use an existing API?

Chris Henson (Jul 10 2025 at 18:08):

Joël Riou said:

Note: a few people (not me) have tried to allow morphisms in categories to be in Sort v instead of Type v, but it failed because of subtleties about universes in Lean.

Would anyone who has attempted this be able to talk a bit more about the universe issues they encountered? Is this because of (non) cumulative universes or something more subtle?

Kevin Buzzard (Jul 10 2025 at 20:23):

IIRC the last time we tried to make the switch was in the Lean 3 days so it might be the case that the data coming from an answer to why it failed is no longer relevant

Chris Hughes (Jul 10 2025 at 20:43):

I tried this change years ago here. There is a small amount of information about what broke. It seems like something to do with the fact that categories arising from preorders are no longer "small" by Lean's definition of small_category at the time. I guess maybe that made it harder to take limits over these diagrams because some categories only have "small" limits. But this is something to do with the funny definition of small_category which is that the homs and the objects live in the same universe, which isn't really what determines if we can take limits. I may be completely wrong about what the issues were there, but that is my guess.

Markus Himmel (Jul 11 2025 at 08:18):

There is more information and some links in this thread: #new members > ✔ Universe Restriction on CategoryTheory.Category


Last updated: Dec 20 2025 at 21:32 UTC