agda / agda-categories

A new Categories library for Agda
https://agda.github.io/agda-categories
MIT License
359 stars 67 forks source link

End calculus #422

Closed 4e554c4c closed 2 weeks ago

4e554c4c commented 1 month ago

This PR is a collection of theorems and refactorings that were developed during my master's thesis.

This includes

Many definitions could be simplified if #419 is resolved.

Considerations

--lossy-unification is currently necessary for Categories.Diagram.End.Fubini. I was hoping that refactoring EndF to use an opaque end-η could fix this, but it does not.

JacquesCarette commented 1 month ago

Re: --lossy-unification. Is this because otherwise it takes way too long? At this this is cause by Agda reconstructing some implicit arguments "the hard way" even though, to use, they are obvious. I've been able to cut some typechecking time down a lot by supplying just the right implicits. One big clue is if you ask Agda for the type of various things and stuff is eta-expanded. This definitely happens in the presence of things that compute, such as ×ᶜ.

4e554c4c commented 1 month ago

Re: --lossy-unification. Is this because otherwise it takes way too long?

Yes, but I don't think this is all about reconstructing implicit arguments. It is also comparing terms. I reference #419 because one of the things that needs to be compared often is apices of ends

4e554c4c commented 3 weeks ago

I can't resolve all of the <greek letter>.dinatural.α blah noise in the fubini proofs. I can move give names to some of them in where clauses if I define the ends using copatterns (as is probably more reasonable anyway). Really the main solution to this would be to resolve agda/agda#7156 and allow for "applying" wedges (or ends) to an object to get the appropriate map.

4e554c4c commented 2 weeks ago

@JacquesCarette whenever you have the time, I would appreciate another look. I haven't changed everything that you suggested, but I left comments wherever I did not.

Taneb commented 2 weeks ago

...would it be possible to split this into several other PRs? It's very big and scary to look at for me (this isn't a requirement but I'd appreciate it)

4e554c4c commented 2 weeks ago

...would it be possible to split this into several other PRs? It's very big and scary to look at for me (this isn't a requirement but I'd appreciate it)

I can't split off too much, since github PRs can't depend on eachother. I split off some misc changes into #423 and #424 (will probably add to both of these later)

JacquesCarette commented 2 weeks ago

Sorry for the slowness - was on vacation all last week.