-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Displayed categories #382
base: master
Are you sure you want to change the base?
Displayed categories #382
Conversation
Taneb
commented
Aug 2, 2023
•
edited
Loading
edited
- Displayed categories
- Total categories
- Displayed setoid reasoning and displayed morphism reasoning
- Displayed functors (defined locally but would be improved by displayed morphism reasoning)
- Displayed natural transformations
- Investigate displayed category of displayed categories#
- Vertical displayed functors
- Vertical displayed natural transformations?
- Category of displayed categories over a fixed base
I've done some work already based on your gist... see my Categorical Playground repo where your code is in Categorical/Displayed and mine in 2Level/Category. Note that I'm not suggesting that my approach in 2Level/Category is 'right', it is very much an experiment that I'm in the middle of. But there might be things in there that could trigger an idea for you. |
; ∘-resp-≈ = λ p q → -, ∘′-resp-[]≈ (proj₂ p) (proj₂ q) | ||
} | ||
|
||
display : Functor ∫ B |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tempting to call this proj1
, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan of the name proj1
for this, personally. It feels like naming the functor after an implementation detail. That said, I'm not set on display
either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of my doodling is exploring how much Displayed
is really the categorical equivalent of a Sigma
type. So it's much more than an implementation detail, there is a very strong analogy at play.
I'm sure there are other, better names (certainly than proj1
). I'm not set against display
, BTW, but I do think it's worth thinking about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This functor is normally called π
in the literature, so proj1
is a fitting name.
F′.₁′ (G′.₁′ C.id′) ≈[]⟨ F′.F′-resp-≈[] G′.identity′ ⟩ | ||
F′.₁′ D.id′ ≈[]⟨ F′.identity′ ⟩ | ||
E.id′ ∎′ | ||
; homomorphism′ = λ {_} {_} {_} {_} {_} {_} {_} {_} {f′} {g′} → begin′ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a good way to avoid having to write quite this many {_}
s to get two of the hidden arguments in scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes: use pattern-matching lambda and then name the ones you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or else λ {f′ = f′} {g′ = g′} → ...
(is that actually the same as, or different from, using a pattern matching lambda?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is different, it turns out. Sometimes this version isn't always accepted by Agda, I've never quite figured out why / when.
CommutativeSquare (a′ ∘ b′) c c″ (a ∘ b) | ||
glue′ {a′ = a′} {c′ = c′} {c″ = c″} {a = a} {b′ = b′} {c = c} {b = b} sq-a sq-b = begin | ||
-- A "rotated" version of glue. Equivalent to 'Equiv.sym (glue (Equiv.sym sq-a) (Equiv.sym sq-b))' | ||
sym-glue : CommutativeSquare a′ c′ c″ a → |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is not final! I just wanted to use the name glue′
for the displayed version of glue
so had to name this something else
One thing I've noticed doing this, I care a lot more about the exact proof that two morphisms are equal than I normally would. This meant it matters, and is a little unfortunate, that equational reasoning syntax has an extraneous I've also been trying to make sure that little things that I'm building on top of have the "right" proofs ("right" is very subjective here). For example, defining some things in |
Yeah, I was somewhat worried about this. In the 1Lab we define (pre)categories to have an hSet of morphisms, which means that we can ignore any sort of coherence issues involved with equalities of equalities. In general, As a concrete example, cartesian morphisms are going to be really problematic. The universal property requires that a morphism be displayed over a composite, which often involves some amount of transport. This comes up when defining the factorization system on a fibration; you end up using the fact that every morphism |
…isplayed categories
where | ||
open DMorphismₚ D′ | ||
|
||
_ⓘₕ′_ : ∀ {C : Category bo bℓ be} {D : Category bo′ bℓ′ be′} {E : Category bo″ bℓ″ be″} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agda struggled to use the variables declared in the variable
block here, causing me to add the category, functor, and displayed category arguments explicitly. Not sure why.
unitor²′ = record { F′⇒G′ = id′∘id′⇒id′ ; F′⇐G′ = id′⇒id′∘id′ ; iso′ = LeftRightId′.iso-id′-id′ idF′ } | ||
|
||
-- associator | ||
module _ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've beaten my own record here, this module has 24 different Level
s as arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impressive indeed. And a little crazy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect in most use cases, until we come up with a notion of "category where the objects can vary in level", this will collapse down to six (three for the base categories and three more for the displayed categories)
; identityˡ′ = unitorˡ′ | ||
; identityʳ′ = unitorʳ′ | ||
; identity²′ = unitor²′ | ||
; assoc′ = λ {_ _ _ _ _ _ _ _ _ _ _ F′ G′ H′} → associator′ H′ G′ F′ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To revisit later: why do these arguments appear in the wrong order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they are via variables, they appear in first-use order, by Agda's definition of "first use", which isn't always easy to predict.
Composition of vertical functors is the first place I've hit where I've not been able to see a way around that we may have lots of different equalities between two functions. In particular, |
Two things come to mind when I see this problem over things "over" equalities:
Obviously these two things pull in polar opposite directions! I'd like to see more details as I'm stumbling in the dark a bit here. (And I'm super interested, as I think the same problem may well surface for both Multicategory and Double category.) Influenced by the above, I would speculate that there are two needs for these proofs: we need them to be there so that things 'line up' properly, and we need them to 'properly exist' for well-definedness. |
Another perspective on this is that E-categories are sort of like half of a bicategory: we've got the 2-dimensional data of a bicategory, yet none of the equations or coherences. Also, I'm pretty convinced that we need more than a type-family of morphisms: we need a setoid-family of morphisms! If you have coherences, equations, and transport, then you might be able to work your way out of this jam. |
I agree that E-categories are very much like bicategories with some of the coherences missing. What's so remarkable is how pretty much all of 1-category theory goes through! Yes, some amount of transport is one way out of this jam. I'm quite curious to see if there are other ways around the problem. [There might not be - but I also thought that the current approach to agda-categories would fail miserably in the first 2 weeks of us porting the old code, and yet here we are...] |
I'm very interested in this as well; even in settings where you do have transport, it tends to be pretty miserable in practice. I see two ways forward on this: the first involves some co-yoneda trickery; instead of having displayed morphisms living directly over some record Over (f : Hom x y) (x' : Ob[ x ]) (y : Ob[ y ]) : Type where
field
base : Hom x y
over : f ≈ base
hom : Hom[ base ] x' y' and then only work in terms of The other approach is to treat things like having fibre categories as honest-to-god structure. This is pretty interesting in its own right, though I'll admit I haven't thought too deeply on it. |
As another addendum: there is a second perspective on E-categories, which is that they are wild categories. FWIW, this makes |
I prefer the "maximally unsaturated" point of view of Peter LeFanu Lumsdaine and Erik Palmgren (i.e. I think the concept is Palmgren's but I learned it from Peter). Unfortunately the slides seem to have disappeared from the Internet per se, but still available in various archives / caches. But I think the video https://youtu.be/glC8tC7xdBY is still available. But on |